brintos

brintos / llvm-project-archived public Read only

0
0
Text · 487 B · fd02998 Raw
15 lines · plain
1// RUN: %check_clang_tidy -std=c++17-or-later %s misc-definitions-in-headers %t2 3class CE {4  constexpr static int i = 5; // OK: inline variable definition.5};6 7inline int i = 5; // OK: inline variable definition.8 9int b = 1;10// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: variable 'b' defined in a header file; variable definitions in header files can lead to ODR violations [misc-definitions-in-headers]11 12// OK: C++14 variable template.13template <class T>14constexpr T pi = T(3.1415926L);15