File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ Bug Fixes in This Version
156
156
157
157
- Fixed the definition of ``ATOMIC_FLAG_INIT `` in ``<stdatomic.h> `` so it can
158
158
be used in C++.
159
+ - Fixed a failed assertion when checking required literal types in C context. (#GH101304).
159
160
160
161
Bug Fixes to Compiler Builtins
161
162
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -8756,7 +8756,8 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
8756
8756
return;
8757
8757
}
8758
8758
8759
- if (NewVD->isConstexpr() && !T->isDependentType() &&
8759
+ if (getLangOpts().CPlusPlus && NewVD->isConstexpr() &&
8760
+ !T->isDependentType() &&
8760
8761
RequireLiteralType(NewVD->getLocation(), T,
8761
8762
diag::err_constexpr_var_non_literal)) {
8762
8763
NewVD->setInvalidDecl();
Original file line number Diff line number Diff line change @@ -357,3 +357,6 @@ void infsNaNs() {
357
357
constexpr double db5 = LD_SNAN ; // expected-error {{constexpr initializer evaluates to nan which is not exactly representable in type 'const double'}}
358
358
constexpr double db6 = INF ;
359
359
}
360
+
361
+ constexpr struct S9 s9 = { }; // expected-error {{variable has incomplete type 'const struct S9'}} \
362
+ // expected-note {{forward declaration of 'struct S9'}}
You can’t perform that action at this time.
0 commit comments