clang/test/CXX/stmt.stmt/stmt.select/stmt.switch/p4.cpp
raw| 1 | // RUN: %clang -fsyntax-only -std=c++20 -Xclang -verify %s |
| 2 | |
| 3 | void Func(int x) { |
| 4 | switch (x) { |
| 5 | [[likely]] case 0: |
| 6 | case 1: |
| 7 | int i = 3; // expected-note {{jump bypasses variable initialization}} |
| 8 | case 2: // expected-error {{cannot jump from switch statement to this case label}} |
| 9 | break; |
| 10 | } |
| 11 | } |