[C++1y] [PATCH 3/4] ... canonical type workaround and refactoring
Jason Merrill
jason@redhat.com
Wed Sep 25 16:42:00 GMT 2013
On 09/24/2013 02:05 AM, Adam Butcher wrote:
> Shall I push the patch below to trunk as an intermediate workaround
> whilst I get to refactoring to support on-the-fly template parm synthesis?
I think let's wait for a better fix.
> On the subject of on-the-fly synthesis: I haven't started yet but I'm
> thinking to trigger in 'cp_parser_simple_type_specifier' when
> 'current_binding_level->kind == sk_function_parms'. I can foresee a
> potential issue with packs in that, upon reading the 'auto' (potentially
> nested in some other type), a plain template parm will be synthesized;
> but it may need to be a pack parm type if '...' is found later.
Hmm, good point.
I think there are two options:
1) Build up the type as normal and use tsubst to replace the non-pack
template parameter with a pack if needed.
2) If we see 'auto', scan ahead (possibly via tentative parsing) to see
if there's a ...
Jason
More information about the Gcc-patches
mailing list