================ @@ -1395,6 +1411,171 @@ bool Parser::HandlePragmaMSAllocText(StringRef PragmaName, return true; } +NestedNameSpecifier * +Parser::zOSParseIdentifier(StringRef PragmaName, + const IdentifierInfo *IdentName) { + NestedNameSpecifier *NestedId = nullptr; + if (PP.getLangOpts().CPlusPlus) { + if (Tok.is(tok::coloncolon)) { + // Nothing to do. + } else if (Actions.CurContext->isNamespace()) { + auto *NS = cast<NamespaceDecl>(Actions.CurContext); + NestedId = + NestedNameSpecifier::Create(Actions.Context, NS->getIdentifier()); + NestedId = + NestedNameSpecifier::Create(Actions.Context, NestedId, IdentName); + PP.Lex(Tok); + } else { + NestedId = NestedNameSpecifier::Create(Actions.Context, IdentName); + PP.Lex(Tok); + } + while (Tok.is(tok::coloncolon)) { + PP.Lex(Tok); + if (Tok.isNot(tok::identifier)) { + PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier) + << PragmaName; + return nullptr; + } + IdentifierInfo *II = Tok.getIdentifierInfo(); ---------------- erichkeane wrote:
Identifier isn't sufficient, what if this is naming a type inside a template? Or a dependent type? https://github.com/llvm/llvm-project/pull/141671 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits