This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/44994] New: [C++0x] ICE on invalid with variadic templates


The below ICEs with:

a.cc:11:32: error: expected nested-name-specifier before ?.? token
a.cc:11:32: error: expected ?>? before ?.? token
a.cc: In instantiation of ?const bool mini_is_constructible<int, A, A>::value?:
a.cc:20:44:   instantiated from here
a.cc:15:63: 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())
      test(int);

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

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

class A { };

int Test[mini_is_constructible<int, A, A>::value ? -1 : 1];


-- 
           Summary: [C++0x] ICE on invalid with variadic templates
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: paolo dot carlini at oracle dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44994


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]