aaron.ballman added a comment.

> Add something like a bool IsDefaulted somewhere in Clang, e.g., in 
> TemplateArgument and consult it from the TypePrinter. This would be much 
> simpler but requires adding a field on one of the Clang types

I think this might be worth exploring as a cleaner solution to the problem. 
`TemplateArgument` has a union of structures for the various kinds of template 
arguments it represents 
(https://github.com/llvm/llvm-project/blob/main/clang/include/clang/AST/TemplateBase.h#L140).
 All of the structures in that union start with an `unsigned Kind` field to 
discriminate between the members. There are only 8 kinds currently 
(https://github.com/llvm/llvm-project/blob/main/clang/include/clang/AST/TemplateBase.h#L63),
 so we could turn `Kind` into a bit-field and then steal a bit for 
`IsDefaulted` without increasing memory overhead. Do you think that's a 
reasonable approach to try instead?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140423/new/

https://reviews.llvm.org/D140423

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to