aaron.ballman added a reviewer: erichkeane.
aaron.ballman added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:7784-7785
   "because namespace %1 does not enclose namespace %2">;
+def err_invalid_declarator_in_export : Error<"cannot export %0 here "
+  "because it had be declared in %1.">;
 def err_invalid_declarator_global_scope : Error<
----------------
I think this diagnostic text is more clear based on the standards text you 
cited. This would also come with a note diagnostic to point to the previous 
declaration.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:5748-5750
+    else if (isa<ExportDecl>(Cur))
+      Diag(Loc, diag::err_invalid_declarator_in_export)
+          << Name << cast<NamedDecl>(DC) << SS.getRange();
----------------
I don't believe this is sufficient to cover [module.interface]p6. I tried out 
the example from the paragraph in the standard and we still silently accept it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112903/new/

https://reviews.llvm.org/D112903

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to