http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57943
Bug ID: 57943
Summary: [c++11] invalid decltype expression accepted in
template default type
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
The following program compiles and apparently defaults T as a, altough a (0) is
not a valid expression.
struct a { };
template <typename T = decltype (a (0))> void f () { }
int main ()
{
// decltype (a (0)) x; // correctly rejected
f ();
}