Skip to content

Commit 1cbdc20

Browse files
authored
Merge branch 'main' into pr-pos-zero
2 parents fac7344 + f874092 commit 1cbdc20

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.ci/utils.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function at-exit {
2424
retcode=$?
2525

2626
mkdir -p artifacts
27+
sccache --show-stats
2728
sccache --show-stats >> artifacts/sccache_stats.txt
2829
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
2930
cp "${MONOREPO_ROOT}"/*.log artifacts/ || :

clang/lib/Sema/SemaDecl.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20270,9 +20270,10 @@ Decl *Sema::ActOnEnumConstant(Scope *S, Decl *theEnumDecl, Decl *lastEnumConst,
2027020270
// different from T:
2027120271
// - every enumerator of every member of class T that is an unscoped
2027220272
// enumerated type
20273-
if (getLangOpts().CPlusPlus && !TheEnumDecl->isScoped())
20274-
DiagnoseClassNameShadow(TheEnumDecl->getDeclContext(),
20275-
DeclarationNameInfo(Id, IdLoc));
20273+
if (getLangOpts().CPlusPlus && !TheEnumDecl->isScoped() &&
20274+
DiagnoseClassNameShadow(TheEnumDecl->getDeclContext(),
20275+
DeclarationNameInfo(Id, IdLoc)))
20276+
return nullptr;
2027620277

2027720278
EnumConstantDecl *New =
2027820279
CheckEnumConstant(TheEnumDecl, LastEnumConst, IdLoc, Id, Val);

clang/test/CXX/class/class.mem/p13.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,12 @@ template<typename B> struct CtorDtorName : B {
114114
CtorDtorName();
115115
~CtorDtorName(); // expected-error {{identifier 'CtorDtorName' after '~' in destructor name does not name a type}}
116116
};
117+
118+
struct S { // expected-note {{'S' declared here}}
119+
enum E {
120+
R = 11,
121+
S = 12 // expected-error {{member 'S' has the same name as its class}}
122+
};
123+
static_assert(E::R == 11, "E::R is not 11");
124+
static_assert(E::S == 12, "E::S is not 12"); // expected-error {{no member named 'S' in 'S::E'}}
125+
};

0 commit comments

Comments
 (0)