[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


================
@@ -1064,6 +1090,8 @@ void DeclPrinter::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) {
 
 void DeclPrinter::VisitEmptyDecl(EmptyDecl *D) {
   prettyPrintAttributes(D);
+  if (const char *lang = tryGetUnbracedLinkageLanguage(D))
+    Out << "extern \"" << lang << "\";";
----------------
AaronBallman wrote:

```suggestion
  if (const char *Lang = tryGetUnbracedLinkageLanguage(D))
    Out << "extern \"" << Lang << "\";";
```

https://github.com/llvm/llvm-project/pull/93131


More information about the cfe-commits mailing list