================
@@ -13080,6 +13080,9 @@ NamedDecl *Sema::BuildUsingDeclaration(
if (R.getAsSingle<NamespaceDecl>()) {
Diag(IdentLoc, diag::err_using_decl_can_not_refer_to_namespace)
<< SS.getRange();
+ // Suggest using 'using namespace ...' instead.
+ Diag(SS.getBeginLoc(), diag::note_namespace_using_decl)
+ << FixItHint::CreateInsertion(SS.getBeginLoc(), "namespace ");
return BuildInvalid();
----------------
zmodem wrote:
I suppose another exercise for our future selves could be to recover as if the
user typed "using namespace"
https://github.com/llvm/llvm-project/pull/94762
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits