variadic templates: spec on pack-expansion in function call?

Milian Wolff mail at milianw.de
Sat Jun 4 09:58:29 UTC 2011


Hey all,

I'm having trouble interpreting the spec on variadic template pack expansion 
inside a function call or a mem-initializer, i.e.:

http://paste.kde.org/78151/

This compiles and there are expamples similar to it on the web and inside the 
spec. Yet I cannot find out how the "args..." is supposed to be parsed AST-
wise. 14.5.3/4 of the spec¹ lists contexts in which a pack-expansion can 
occur:

> — In an initializer-list (8.5); the pattern is an initializer-clause.
> — In a base-specifier-list (Clause 10); the pattern is a base-specifier.
> — In a mem-initializer-list (12.6.2); the pattern is a mem-initializer.
> — In a template-argument-list (14.3); the pattern is a template-argument.
> — In a dynamic-exception-specification (15.4); the pattern is a type-id.
> — In an attribute-list (7.6.1); the pattern is an attribute.
> — In an alignment-specifier (7.6.2); the pattern is the alignment-specifier
> without the ellipsis. — In a capture-list (5.1.2); the pattern is a
> capture.

None of these apply to "args..." in my opinion. This is a quite generic 
expression after all.

There is another document² linked to from the GCC 4.6 c++0x support page³ on 
variadic templates. It is quite outdated as you can see yet includes the 
following AST spec:

"assignment-expression ...opt"

This could be used for "args..." afair. But why is there nothing related in 
the last spec? Can someone shed some light on it?

¹: http://www.open-std.org/jtc1/sc22/wg21/prot/14882fdis/n3291.pdf
somewhat outdated, but the FDIS spec is no different in that regard
²: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf
³: http://gcc.gnu.org/gcc-4.6/cxx0x_status.html

Thanks, bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20110604/8c883906/attachment.sig>


More information about the KDevelop-devel mailing list