[clang] [clang][AST] fix ast-print of `extern <lang>` with >=2 declarators (PR #93131)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu May 30 06:49:29 PDT 2024
================
@@ -932,6 +953,11 @@ void DeclPrinter::VisitVarDecl(VarDecl *D) {
: D->getASTContext().getUnqualifiedObjCPointerType(D->getType());
if (!Policy.SuppressSpecifiers) {
+ if (const char *lang = tryGetUnbracedLinkageLanguage(D)) {
+ // the "extern" specifier is implicit
+ assert(D->getStorageClass() == SC_None);
+ Out << "extern \"" << lang << "\" ";
+ }
----------------
AaronBallman wrote:
```suggestion
if (const char *Lang = tryGetUnbracedLinkageLanguage(D)) {
// the "extern" specifier is implicit
assert(D->getStorageClass() == SC_None);
Out << "extern \"" << Lang << "\" ";
}
```
https://github.com/llvm/llvm-project/pull/93131
More information about the cfe-commits
mailing list