[all-commits] [llvm/llvm-project] 40acc0: Improve type printing of size-dependent const arra...

David Blaikie via All-commits all-commits at lists.llvm.org
Wed Sep 15 13:47:11 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 40acc0adad59ac39e9a7a02fcd93161298500c00
      https://github.com/llvm/llvm-project/commit/40acc0adad59ac39e9a7a02fcd93161298500c00
  Author: David Blaikie <dblaikie at gmail.com>
  Date:   2021-09-15 (Wed, 15 Sep 2021)

  Changed paths:
    M clang/lib/AST/TypePrinter.cpp
    M clang/test/AST/ast-dump-array.cpp

  Log Message:
  -----------
  Improve type printing of size-dependent const arrays to normalize array-of-const and const-array

Follow-on from 2bd84938470bf2e337801faafb8a67710f46429d based on
postcommit feedback from Richard Smith.

The VariableArray case I couldn't figure out how to test/provoke - you
can't write/form a variable array in any context other than a local
variable that I know of, and in that case `const int x[n]` is the
normalized form already (array-of-const) and you can't use typedefs
(since you can't typedef int[n] with variable 'n') to force the
const-array AST that would produce the undesirable type printing "int
const [n]".




More information about the All-commits mailing list