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
4 changes: 3 additions & 1 deletion clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,10 @@ Bug Fixes in This Version
- In C23, something like ``[[/*possible attributes*/]];`` is an attribute
declaration, not a statement. So it is not allowed by the syntax in places
where a statement is required, specifically as the secondary block of a
selection or iteration statement. This differs from C++, since C++ allows
selection or iteration statement. This differs from C++, since C++ allows
declaration statements. Clang now emits a warning for these patterns. (#GH141659)
- Fixed false positives for redeclaration errors of using enum in
nested scopes. (#GH147495)

Bug Fixes to Compiler Builtins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaDeclCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13308,7 +13308,7 @@ NamedDecl *Sema::BuildUsingEnumDeclaration(Scope *S, AccessSpecifier AS,
LookupResult Previous(*this, UsingEnumName, LookupUsingDeclName,
RedeclarationKind::ForVisibleRedeclaration);

LookupName(Previous, S);
LookupQualifiedName(Previous, CurContext);

for (NamedDecl *D : Previous)
if (UsingEnumDecl *UED = dyn_cast<UsingEnumDecl>(D))
Expand Down
14 changes: 14 additions & 0 deletions clang/test/SemaCXX/cxx20-using-enum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,18 @@ void f(int a) {
}
}

namespace GH147495 {
struct S {
enum class E { A };
using enum E;

struct S1 {
using enum E;
};

struct S2 {
using E::A;
};
};
}
#endif