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

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 1 17:19:32 PDT 2018


rsmith accepted this revision.
rsmith added inline comments.


================
Comment at: Sema/SemaDecl.cpp:4659-4661
+          (isa<TranslationUnitDecl>(OwnerScope) ||
+           (isa<NamespaceDecl>(OwnerScope) &&
+            cast<NamespaceDecl>(OwnerScope)->getDeclName()))) {
----------------
jkorous wrote:
> 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?
Sorry, yes, thinko on my part.


https://reviews.llvm.org/D45884





More information about the cfe-commits mailing list