can we have gcc -E (macro expansion) equivalent for templates ?

49 views
Skip to first unread message

kaj...@gmail.com

unread,
Aug 2, 2017, 6:04:13 PM8/2/17
to ISO C++ Standard - Discussion
Would be possible to express all types generated by compiler to separate file (even with mangled names)?

It would be very useful , for debugging any meta programs.

I think I saw tools which can do it, too expensive though

KrisK

Richard Smith

unread,
Aug 2, 2017, 6:36:47 PM8/2/17
to std-dis...@isocpp.org
This seems like a question best addressed at your implementer, not a question about the C++ standard itself (which is what this list is for).

If you use clang, try passing "-Xclang -ast-print -S". The output is "for information only" (ie, we don't guarantee that it will work if fed back into a compiler, and it's generally provided on a best-effort basis), so it's not quite the same as a -E output, but it shows what your templates instantiate into in clang's AST representation.

Ville Voutilainen

unread,
Aug 2, 2017, 6:37:19 PM8/2/17
to std-dis...@isocpp.org
Reply all
Reply to author
Forward
0 new messages