clang/test/AST/ByteCode/extern.cpp
raw| 1 | // RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify=both,expected %s |
| 2 | // RUN: %clang_cc1 -verify=both,ref %s |
| 3 | |
| 4 | // both-no-diagnostics |
| 5 | |
| 6 | extern const double Num; |
| 7 | extern const double Num = 12; |
| 8 | |
| 9 | extern const int E; |
| 10 | constexpr int getE() { |
| 11 | return E; |
| 12 | } |
| 13 | const int E = 10; |
| 14 | static_assert(getE() == 10); |
| 15 |