iains added inline comments.

================
Comment at: clang/lib/Sema/SemaModule.cpp:814-815
+        diagExportedUnnamedDecl(S, UnnamedDeclKind::Namespace, D, BlockStart);
+      else
+        ; // We allow an empty named namespace decl.
+    } else if (DC->getRedeclContext()->isFileContext() && !isa<EnumDecl>(D))
----------------
ChuanqiXu wrote:
> I think we should remove it. So that the above `if` could be further merged.
we can remove the else ; but we cannot merge the !HasName into the if (that 
changes the logic of the expression such that empty & unnamed namespace decls 
get passed to checkExportedDeclContext()) - which emits a diagnostic not 
expected by the standard.

For me, the 'else ;' makes it clear what the alternative is doing (and there's 
a comment as well) - but if the general opinions is to remove it, that's also 
fine.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122119

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

Reply via email to