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
Copy file name to clipboardExpand all lines: clang/test/SemaCXX/builtin-is-constant-evaluated.cpp
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -156,6 +156,15 @@ namespace narrowing {
156
156
}
157
157
158
158
structGH99680 {
159
-
staticconstintx = 1/(1-__builtin_is_constant_evaluated()); // expected-error {{in-class initializer for static data member is not a constant expression}} \
159
+
staticconstintx1 = 1/(1-__builtin_is_constant_evaluated()); // expected-error {{in-class initializer for static data member is not a constant expression}} \
staticconstfloat x3 = 1/(1-__builtin_is_constant_evaluated()); // expected-error {{in-class initializer for static data member of type 'const float' requires 'constexpr' specifier}} \
164
+
// expected-note {{add 'constexpr'}} \
165
+
// expected-error {{in-class initializer for static data member is not a constant expression}} \
166
+
// expected-note {{division by zero}}
167
+
staticconstfloat x4 = __builtin_is_constant_evaluated(); // expected-error {{in-class initializer for static data member of type 'const float' requires 'constexpr' specifier}} \
0 commit comments