================
@@ -1398,16 +1400,20 @@ void DeclSpec::CheckTypeSpec(Sema &S, const
PrintingPolicy &Policy) {
diag::err_invalid_decl_spec_combination)
<< DeclSpec::getSpecifierName(getStorageClassSpec())
<< SourceRange(getStorageClassSpecLoc());
- // Discard the thread storage class specifier to recover.
- ThreadStorageClassSpec = TSCS_unspecified;
- ThreadStorageClassSpecLoc = SourceLocation();
+ DiscardThreadStorageClassSpec = true;
}
if (S.getLangOpts().C23 &&
getConstexprSpecifier() == ConstexprSpecKind::Constexpr) {
S.Diag(ConstexprLoc, diag::err_invalid_decl_spec_combination)
<< DeclSpec::getSpecifierName(getThreadStorageClassSpec())
<< SourceRange(getThreadStorageClassSpecLoc());
}
+ if (DiscardThreadStorageClassSpec) {
+ // Delay recovery until after diagnosing a possible constexpr conflict.
+ // FIXME: Clear C23ThreadLocalSpelling here when that field is added.
----------------
Fznamznon wrote:
I'm not sure it is great idea to reference nonexistent things yet. What if
reviewers of the patch that adds this field won't like the idea or the name?
https://github.com/llvm/llvm-project/pull/236758
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits