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/Sema/constexpr.c
+10-3Lines changed: 10 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -402,10 +402,17 @@ bool issue155507(v2int16_t a, v2int16_t b) {
402
402
constexpr boolb2= (bool)nullptr;
403
403
_Static_assert(!b2);
404
404
405
-
doubleghissue173847(doublea) {
405
+
doublegh173847_double(doublea) {
406
406
doubleresult=3.0 / (a+4.5-2.1*0.7);
407
407
returnresult;
408
408
}
409
-
voidghissue173847_test() {
410
-
constexpr floatf_const=ghissue173847(2.0); // expected-error {{constexpr variable 'f_const' must be initialized by a constant expression}}
409
+
410
+
long doublegh173847_long_double(long doublea) {
411
+
long doubleresult=3.0L / (a+4.5L-2.1L*0.7L);
412
+
returnresult;
413
+
}
414
+
415
+
voidgh173847_test() {
416
+
constexpr doubled_const=gh173847_double(2.0); // expected-error {{constexpr variable 'd_const' must be initialized by a constant expression}}
417
+
constexpr long doubleld_const=gh173847_long_double(2.0L); // expected-error {{constexpr variable 'ld_const' must be initialized by a constant expression}}
0 commit comments