User account creation filtered due to spam.

Bug 44994

Summary: [C++0x] ICE on invalid with variadic templates
Product: gcc Reporter: Paolo Carlini <paolo.carlini>
Component: c++Assignee: Jason Merrill <jason>
Severity: normal CC: gcc-bugs, jason, redi
Priority: P3 Keywords: ice-on-invalid-code
Version: 4.6.0   
Target Milestone: 4.6.1   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2011-05-25 20:42:04

Description Paolo Carlini 2010-07-19 18:27:02 UTC
The below ICEs with: error: expected nested-name-specifier before ‘.’ token error: expected ‘>’ before ‘.’ token In instantiation of ‘const bool mini_is_constructible<int, A, A>::value’:   instantiated from here error: no matching function for call to ‘mini_is_constructible<int, A, A>::test(int)’

Internal compiler error: Error reporting routines re-entered.


template<typename Tp, typename... Args>
  class mini_is_constructible
    typedef char one;
    typedef struct { char arr[2]; } two;

    template<typename Tp1, typename... Args1>
      static decltype(Tp1(Args1()...), one())

    template<typename, typename..> // Note missing dot.
      static two test(...);

    static const bool value = sizeof(test<Tp, Args...>(0)) == 1;

class A { };

int Test[mini_is_constructible<int, A, A>::value ? -1 : 1];
Comment 1 Jason Merrill 2011-05-25 20:41:24 UTC
*** Bug 49156 has been marked as a duplicate of this bug. ***
Comment 2 Jason Merrill 2011-05-26 03:07:05 UTC
Fixed for 4.6.1.