[PATCH] D45884: [Sema] Fix parsing of anonymous union in language linkage specification

Jan Korous via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 1 08:08:24 PDT 2018


jkorous marked an inline comment as done.
jkorous added a comment.

Volodymyr, could you please confirm that the non-anonymous vs non-inline logic makes sense to you?



================
Comment at: Sema/SemaDecl.cpp:4659-4661
+          (isa<TranslationUnitDecl>(OwnerScope) ||
+           (isa<NamespaceDecl>(OwnerScope) &&
+            cast<NamespaceDecl>(OwnerScope)->getDeclName()))) {
----------------
rsmith wrote:
> vsapsai wrote:
> > Checked if we need to do the same change s/Owner/OwnerScope/ elsewhere in this method and looks like it is not required. We care if the owner is a Record and we don't allow linkage specification in classes, so skipping linkage scopes doesn't give us anything.
> While you're here, `OwnerScope->isFileContext() && !OwnerScope->isInlineNamespace()` might be clearer. Or at least replace the `getDeclName()` with `!isInlineNamespace()`.
I'd like to explicitly flag this - we are interested in non-anonymous namespaces not non-inline namespaces, right?


https://reviews.llvm.org/D45884





More information about the cfe-commits mailing list