You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constexprstaticint i = 5; // OK: inline variable definition.
5
+
};
6
+
7
+
inlineint i = 5; // OK: inline variable definition.
8
+
9
+
int 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]
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: function 'f' defined in a header file; function definitions in header files can lead to ODR violations [misc-definitions-in-headers]
@@ -175,3 +175,5 @@ template <typename T>
175
175
int CD<T, int>::f() { // OK: partial template specialization.
176
176
return0;
177
177
}
178
+
179
+
constexprint k = 1; // OK: constexpr variable has internal linkage.
0 commit comments