[PATCH] D134453: Introduce the `AlwaysIncludeTypeForNonTypeTemplateArgument` into printing policy

Nenad Mikša via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 22 09:51:27 PDT 2022


DoDoENT created this revision.
Herald added a project: All.
DoDoENT requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

If enabled, it will ensure that full type name is always printed.
This should fix issue reported here: https://github.com/llvm/llvm-project/issues/57562

Currently, I've disabled the policy by default, as enabling it makes some tests fail, notably:

- CodeGenCXX/debug-info-template.cpp
- SemaCXX/constexpr-printing.cpp
- SemaCXX/cxx2a-nttp-printing.cpp
- SemaTemplate/temp_arg_string_printing.cpp

However, my opinion is that those tests should be updated and new policy always enabled, to mimic GCC's behavior.

I've added 2 new tests in AST/TypePrinterTest.cpp, one of which actually demonstrates the issue I've had in the first place (which was also reported on GitHub).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134453

Files:
  clang/include/clang/AST/PrettyPrinter.h
  clang/lib/AST/APValue.cpp
  clang/lib/AST/TemplateBase.cpp
  clang/unittests/AST/TypePrinterTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134453.462217.patch
Type: text/x-patch
Size: 5711 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220922/14801aaa/attachment.bin>


More information about the cfe-commits mailing list