In handling C++03 subclause 15.4 [except.spec] paragraph 3, it seems to me that an exception-specification containing a dependent type-id should not be checked to see if it only allows exceptions that are allowed by another (non-empty) exception-specification while processing the template definition (versus an instantiation).
SOURCE (<stdin>):
struct A {
virtual void foo() throw(int) = 0;
};
template <typename T>
struct B : A {
virtual void foo() throw(T);
};
COMPILER INVOCATION:
clang -fsyntax-only -x c++ -
ACTUAL OUTPUT:
<stdin>:7:17: error: exception specification of overriding function is more lax than base version
virtual void foo() throw(T);
^
<stdin>:2:17: note: overridden virtual function is here
virtual void foo() throw(int) = 0;
^
1 error generated.
Extended Description
In handling C++03 subclause 15.4 [except.spec] paragraph 3, it seems to me that an exception-specification containing a dependent
type-id
should not be checked to see if it only allows exceptions that are allowed by another (non-empty) exception-specification while processing the template definition (versus an instantiation).SOURCE (
<stdin>
):COMPILER INVOCATION:
ACTUAL OUTPUT:
EXPECTED OUTPUT:
No errors.
COMPILER VERSION INFO: