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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu May 23 09:08:41 PDT 2024


================
@@ -1145,13 +1145,15 @@ void DeclPrinter::VisitLinkageSpecDecl(LinkageSpecDecl *D) {
     l = "C++";
   }
 
+  bool HasMoreThanOneDecl =
+      *D->decls_begin() && D->decls_begin()->getNextDeclInContext();
----------------
erichkeane wrote:

```suggestion
      !D->decls().empty() && (++D->decls_begin() ) != D->decls_end()`
```
WDYT?

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


More information about the cfe-commits mailing list