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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
The report misses a complete example. The following is a reduced form and free
of library stuff:

//-------------------------------------------------------
struct true_type { enum { value = true }; };
struct false_type { enum { value = false }; };

template<bool BoolVal, char CharVal>
struct Foo {};

template<typename... Ts>
struct is_instantiation_of_nontypes
{
  template<template<Ts...> class TT, typename T>
  struct check : false_type {};

  template<template<Ts...> class TT, Ts... Args>
  struct check<TT, TT<Args...>> : true_type {};
};

static_assert(is_instantiation_of_nontypes<bool, char>::check<Foo, Foo<false,
'x'> >::value, "Ouch");
//-------------------------------------------------------

compiled with gcc 4.9.0 20130505 (experimental) gives the error

"main.cpp|14|error: 'Ts ...' is not a valid type for a template non-type
parameter|
main.cpp|14|error: template argument 2 is invalid|
main.cpp|17|error: type/value mismatch at argument 1 in template parameter list
for 'template<class ... Ts> template<template<template<Ts ...<anonymous> >
class TT, class T> template<class ... Ts> template<Ts ...<anonymous> > class
TT, class T> struct is_instantiation_of_nontypes<Ts>::check'|
\main.cpp|17|error:   expected a template of type 'template<class ... Ts>
template<Ts ...<anonymous> > class TT', got 'template<bool BoolVal, char
CharVal> struct Foo'"

Reply via email to