Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Clang] prevent setting default lexical access specifier for missing primary declarations #112424

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a22c6ba
[Clang] prevent setting default lexical access specifier for missing …
a-tarasyuk Oct 15, 2024
83ce02f
prevent assertion failure by handling invalid enum forward declarations
a-tarasyuk Oct 18, 2024
47633cc
Merge branch 'main' into fix/112208
a-tarasyuk Oct 18, 2024
1c95b7f
Merge branch 'main' into fix/112208
a-tarasyuk Oct 18, 2024
ca046e4
Merge branch 'main' into fix/112208
a-tarasyuk Oct 18, 2024
a17e84b
Merge branch 'main' into fix/112208
a-tarasyuk Oct 18, 2024
59e54ca
Merge branch 'main' of https://github.com/llvm/llvm-project into fix/…
a-tarasyuk Oct 18, 2024
d3aea99
Merge branch 'main' into fix/112208
a-tarasyuk Oct 19, 2024
f1e0357
Merge branch 'main' into fix/112208
a-tarasyuk Oct 19, 2024
e473224
Merge branch 'main' into fix/112208
a-tarasyuk Oct 19, 2024
047dada
Merge branch 'main' into fix/112208
a-tarasyuk Oct 19, 2024
f3b7b64
Merge branch 'main' into fix/112208
a-tarasyuk Oct 19, 2024
3a3439d
Merge branch 'main' into fix/112208
a-tarasyuk Oct 20, 2024
b857a8a
Merge branch 'main' into fix/112208
a-tarasyuk Oct 20, 2024
d879fd1
Merge branch 'main' into fix/112208
a-tarasyuk Oct 22, 2024
d321cd0
Merge branch 'main' into fix/112208
a-tarasyuk Oct 24, 2024
a78331f
Merge branch 'main' into fix/112208
a-tarasyuk Oct 24, 2024
f490f77
Merge branch 'main' into fix/112208
a-tarasyuk Oct 24, 2024
ef27720
Merge branch 'main' into fix/112208
a-tarasyuk Oct 25, 2024
8d50c3f
Merge branch 'main' into fix/112208
a-tarasyuk Oct 29, 2024
82e3dda
remove redundant Name check
a-tarasyuk Oct 30, 2024
1d1d39c
Merge branch 'fix/112208' of https://github.com/a-tarasyuk/llvm-proje…
a-tarasyuk Oct 30, 2024
05e13d9
Merge branch 'main' of https://github.com/llvm/llvm-project into fix/…
a-tarasyuk Oct 30, 2024
5ee7443
Merge branch 'main' into fix/112208
a-tarasyuk Oct 30, 2024
66573ba
Merge branch 'main' into fix/112208
a-tarasyuk Oct 30, 2024
dc3da53
Merge branch 'main' into fix/112208
a-tarasyuk Oct 30, 2024
fe033be
Merge branch 'main' into fix/112208
a-tarasyuk Oct 30, 2024
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
3 changes: 2 additions & 1 deletion clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,9 @@ Bug Fixes to C++ Support
- Clang incorrectly considered a class with an anonymous union member to not be
const-default-constructible even if a union member has a default member initializer.
(#GH95854).
- Fixed an assertion failure when evaluating an invalid expression in an array initializer. (#GH112140)
- Fixed an assertion failure when evaluating an invalid expression in an array initializer (#GH112140)
- Fixed an assertion failure in range calculations for conditional throw expressions. (#GH111854)
- Fixed an assertion failure caused by invalid enum forward declarations. (#GH112208)

Bug Fixes to AST Handling
^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Sema/SemaDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17957,6 +17957,8 @@ Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, SourceLocation KWLoc,
<< Name;
Invalid = true;
}
if (TUK == TagUseKind::Declaration && Name)
a-tarasyuk marked this conversation as resolved.
Show resolved Hide resolved
Invalid = true;
} else if (!PrevDecl) {
Diag(Loc, diag::warn_decl_in_param_list) << Context.getTagDeclType(New);
}
Expand Down
8 changes: 8 additions & 0 deletions clang/test/SemaCXX/enum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,11 @@ struct PR28903 {
})
};
};

namespace GH112208 {
class C {
enum E { e = 0 };
void f(int, enum E;); // expected-error {{ISO C++ forbids forward references to 'enum' types}} \
// expected-error {{unexpected ';' before ')'}}
};
}