The following C++ code should not compile:

template <class T>
void foo(T) throw (int);

template<>
void
foo (short) throw (short)
{
}

The change in exception specification, the throw, is not been detected. A
simple example without templates is rejected correctly.

The C++ standard discusses this in clause 15.4/2.


-- 
           Summary: Conflicting exception specifications not rejected in
                    template specialization
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andrew dot stubbs at st dot com


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

Reply via email to