[all-commits] [llvm/llvm-project] 7b8048: [clang][AST] fix ast-print of `extern <lang>` with...

Artem Yurchenko via All-commits all-commits at lists.llvm.org
Thu May 30 13:19:10 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b8048939024841e07f8d89ddfaa4311f9dd7e9c
      https://github.com/llvm/llvm-project/commit/7b8048939024841e07f8d89ddfaa4311f9dd7e9c
  Author: Artem Yurchenko <44875844+temyurchenko at users.noreply.github.com>
  Date:   2024-05-30 (Thu, 30 May 2024)

  Changed paths:
    M clang/lib/AST/DeclPrinter.cpp
    A clang/test/AST/ast-print-language-linkage.cpp

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

Problem: the printer used to ignore all but the first declarator for
unbraced language linkage declarators. Furthemore, that one would be
printed without the final semicolon.

Solution: when there is more than one declarator, we print them in a
braced `extern <lang>` block. If the original declaration was unbraced
and there is one or less declarator, we omit the braces, but add the
semicolon.

**N.B.** We are printing braces which were, in some cases, absent from
the original CST. If that's an issue, I'll work on it. See the tests for
the examples.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list