Very recently we started to reject

class Compressible;
template <class T, class EngineTag> class Engine;
template <class T>
class Engine<T, Compressible>
{
public:
  typedef T Element_t;
  Element_t read(int);
};

template <class T>
T Engine<T, Compressible>::read(int)
{
}

Engine<int, Compressible> x;

with

t2.ii:12:3: error: prototype for 'T Engine<T, Compressible>::read(int)' does
not match any in class 'Engine<T, Compressible>'
t2.ii:8:13: error: candidate is: Element_t Engine<T, Compressible>::read(int)

(testcase reduced from tramp3d).

But the following is accepted:

template <class T>
class Engine
{
public:
  typedef T Element_t;
  Element_t read(int);
};

template <class T>
T Engine<T>::read(int)
{
}

Engine<int> x;


-- 
           Summary: [4.5 Regression] Rejects specialization
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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

Reply via email to