[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 21 07:28:14 PDT 2024


================
@@ -140,6 +140,11 @@ Parser::DeclGroupPtrTy Parser::ParseNamespace(DeclaratorContext Context,
       SkipUntil(tok::semi);
       return nullptr;
     }
+    if (!ExtraNSs.empty()) {
+      Diag(IdentLoc, diag::err_unexpected_qualified_namespace_alias);
----------------
Sirraide wrote:

This is more of a cosmetic thing, but it would be nice to `<<` a `SourceRange` here that contains everything from the first `::` to the last identifier (e.g. in `namespace a::b::c = d`, that would be `::b::c`) so we underline it in the diagnostic, and maybe also use the location of the first `::` as the location for the diagnostic.

https://github.com/llvm/llvm-project/pull/86122


More information about the cfe-commits mailing list