[cfe-dev] Why is "..." printed 'After' the arg name in TypePrinter?
Manasij Mukherjee
manasij7479 at gmail.com
Tue Jul 22 01:40:14 PDT 2014
Hi
I was experimenting with printing out variadic templates with clang.
I had a slight issue with how TypePrinter works for function arguments in
variadic function templates.
If I have this in my original source file:
template <typename T, typename ...U>
void foo(T t,U... args)
{
}
TypePrinter currently generates this:
U args...
which should have been
U... args
as far as I know.
Is there some policy I can set to change this behaviour?
I had to slightly modify the the implementation to get what I expected.
There are two functions in TypePrinter.cpp as follows:
void TypePrinter::printPackExpansionBefore(const PackExpansionType *T,
raw_ostream &OS) {
printBefore(T->getPattern(), OS);
OS << "...";
}
void TypePrinter::printPackExpansionAfter(const PackExpansionType *T,
raw_ostream &OS) {
printAfter(T->getPattern(), OS);
}
The line:
OS << "...";
was previously in printPackExpansionAfter.
Why ?
Any side effects of moving it to the before function, as I did ?
Manasij Mukherjee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140722/ac5da789/attachment.html>
More information about the cfe-dev
mailing list