[clang] [clang][AST] fix ast-print of `extern <lang>` with >=2 declarators (PR #93131)

Artem Yurchenko via cfe-commits cfe-commits at lists.llvm.org
Thu May 30 10:26:22 PDT 2024


================
@@ -662,6 +678,11 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
   CXXConversionDecl *ConversionDecl = dyn_cast<CXXConversionDecl>(D);
   CXXDeductionGuideDecl *GuideDecl = dyn_cast<CXXDeductionGuideDecl>(D);
   if (!Policy.SuppressSpecifiers) {
+    if (const char *lang = tryGetUnbracedLinkageLanguage(D)) {
+      // the "extern" specifier is implicit
+      assert(D->getStorageClass() == SC_None);
+      Out << "extern \"" << lang << "\" ";
+    }
----------------
temyurchenko wrote:

fixed

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


More information about the cfe-commits mailing list