Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang/lib/Sema/DeclSpec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,7 @@ void DeclSpec::CheckTypeSpec(Sema &S, const PrintingPolicy &Policy) {
}
// Mark as error to prevent further processing
TypeSpecType = TST_error;
TypeSpecOwned = false;
} else if (!S.getLangOpts().CPlusPlus) {
// For C, C23, etc., convert 'auto' to storage class specifier
// (This is already handled above for C23, but keep for other C dialects)
Expand Down
3 changes: 3 additions & 0 deletions clang/test/SemaCXX/auto-cxx0x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ void f() {
auto int arr[10]; // expected-error {{'auto' cannot be combined with a type specifier}}
}

struct PR209000 {
} auto; // expected-error {{'auto' cannot be combined with a type specifier}}

typedef auto PR25449(); // expected-error {{'auto' not allowed in typedef}}

thread_local auto x; // expected-error {{requires an initializer}}
Expand Down
Loading