================
@@ -39,7 +39,8 @@ bool Sema::SetMemberAccessSpecifier(NamedDecl *MemberDecl,
                                     AccessSpecifier LexicalAS) {
   if (!PrevMemberDecl) {
     // Use the lexical access specifier.
-    MemberDecl->setAccess(LexicalAS);
----------------
a-tarasyuk wrote:

> The current diagnostic does not fit this case though and maybe it has to be 
> tweaked some more.

@shafik Thanks for the feedback! I initially considered marking the new 
declaration invalid based on `TUK_Declaration`, but I wasn’t entirely sure 
because of its relation to the new declaration

https://github.com/llvm/llvm-project/blob/7be1dc0f32f43331c049725e0e2b902e74115779/clang/lib/Sema/SemaDecl.cpp#L17953-L17954

I’ve made changes to handle this case based on TUK_Declaration. If we need to 
add a diagnostic message (_something like a general message saying `"enum" 
cannot appear here`_), just let me know and I’ll add it...



https://github.com/llvm/llvm-project/pull/112424
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to