Skip to content

Commit 9e9f328

Browse files
committed
add check type specifier
1 parent 9bbce08 commit 9e9f328

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang/lib/Sema/DeclSpec.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,7 @@ void DeclSpec::Finish(Sema &S, const PrintingPolicy &Policy) {
13691369

13701370
if (S.getLangOpts().C23 &&
13711371
getConstexprSpecifier() == ConstexprSpecKind::Constexpr &&
1372+
getTypeSpecType() != TST_unspecified &&
13721373
(StorageClassSpec == SCS_extern || StorageClassSpec == SCS_auto)) {
13731374
S.Diag(ConstexprLoc, diag::err_invalid_decl_spec_combination)
13741375
<< DeclSpec::getSpecifierName(getStorageClassSpec())

0 commit comments

Comments
 (0)