================
@@ -6469,9 +6469,22 @@ bool Sema::diagnoseQualifiedDeclaration(CXXScopeSpec
&SS, DeclContext *DC,
// The cases that DC is not NamespaceDecl should be handled in
// CheckRedeclarationExported.
return false;
- } else
+ } else {
+ unsigned DCKind = diag::EnclosingDeclKind::Namespace;
+ if (auto *TD = dyn_cast<TagDecl>(DC)) {
+ if (TD->isStruct())
+ DCKind = diag::EnclosingDeclKind::Struct;
+ else if (TD->isClass())
+ DCKind = diag::EnclosingDeclKind::Class;
+ else if (TD->isUnion())
+ DCKind = diag::EnclosingDeclKind::Union;
+ else if (TD->isEnum())
+ DCKind = diag::EnclosingDeclKind::Enum;
----------------
zwuis wrote:
I'd like to see tests for these branches.
https://github.com/llvm/llvm-project/pull/230630
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits