[Bug c++/57384] can't expand a parameter pack into a list of function types or function pointer types

2013-05-23 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57384

--- Comment #1 from Jonathan Wakely redi at gcc dot gnu.org ---
(In reply to Eric Niebler from comment #0)
 I believe all of the following 4 test cases should pass:

I'll leave it to someone else to rule on that, they make my head hurt ;)

I will note that this works:

  using type2 = listint(Ts)...;

and this works:

  using type4 = listint(*)(Ts)...;

And of course all these work:

  templateclass X 
using F = int(X);   
  using type1 = void(FTs...); 
  using type2 = listFTs...;
  templateclass X 
using Fp = int(*)(X);   
  using type3 = void(FpTs...);   
  using type4 = listFpTs...;


[Bug c++/57384] can't expand a parameter pack into a list of function types or function pointer types

2013-05-23 Thread daniel.kruegler at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57384

--- Comment #2 from Daniel Krügler daniel.kruegler at googlemail dot com ---
I have the impression that this *could* be related to

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1488

This is unchecked yet, because I'm leaving my place here.

[Bug c++/57384] can't expand a parameter pack into a list of function types or function pointer types

2013-05-23 Thread eric.niebler at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57384

--- Comment #3 from Eric Niebler eric.niebler at gmail dot com ---
Interesting. I filed a similar bug against clang
(http://llvm.org/bugs/show_bug.cgi?id=16118), where Richard Smith seems to feel
the test cases should be:

  templatetypename ...Ts
  struct list
  {};

  templatetypename ...Ts
  struct S
  {
  using type1 = void(int...(Ts));// (1) fails
  using type2 = listint(Ts)...;// (2) works
  using type3 = void(int(*...)(Ts)); // (3) fails
  using type4 = listint(*)(Ts)...; // (4) works
  };

This strikes me as ludicrously inconsistent. I think we need guidance from the
committee here. I was basing my bug report(s) on the example in 8.3.5/13 (which
shows:

   templatetypename... T void f(T (* ...t)(int, int));

The suggestion that the pack expansion syntax differs depending on the context
in which the expansion occurs is, um, unsatisfactory.