The C++ frontend rejects the following IMHO valid code snippet since GCC 3.4.0:

==================================================
template<typename T> struct A
{
    template<template<T> class> struct B {};
    template<T> struct C;
    B<C> b;
};

A<int> a;
==================================================

bug.cc: In instantiation of 'A<int>':
bug.cc:8:   instantiated from here
bug.cc:5: error: type/value mismatch at argument 1 in template parameter list
for 'template<class T> template<template<template<T <anonymous> >
class<template-parameter-2-1> > template<class T> template<T <anonymous> >
class<template-parameter-2-1> > struct A<T>::B'
bug.cc:5: error:   expected a template of type 'template<class T> template<T
<anonymous> > class<template-parameter-2-1>', got 'template<int <anonymous> >
struct A<int>::C'

The code compiles if I replace T by int inside A.


-- 
           Summary: [4.0/4.1/4.2 regression] Valid template-template-
                    parameter rejected
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: rejects-valid, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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

Reply via email to