clang\test\CXX\temp\temp.param\p14.cpp

Aaron Ballman aaron at aaronballman.com
Tue May 27 07:26:42 PDT 2014


This test is currently XFAILed, without any real explanation as to
why. When I compile the test, I get:

E:\llvm\2013>clang -fsyntax-only E:\llvm\llvm\tools\clang\test\CXX\temp\temp.par
am\p14.cpp
E:\llvm\llvm\tools\clang\test\CXX\temp\temp.param\p14.cpp:5:32: error: use of
      undeclared identifier 'T'
template<typename T = typename T::type> struct X; // expected-error{{default}}
                               ^
E:\llvm\llvm\tools\clang\test\CXX\temp\temp.param\p14.cpp:5:35: error: expected
      a qualified name after 'typename'
template<typename T = typename T::type> struct X; // expected-error{{default}}
                                  ^
E:\llvm\llvm\tools\clang\test\CXX\temp\temp.param\p14.cpp:5:35: error: type-id
      cannot have a name
template<typename T = typename T::type> struct X; // expected-error{{default}}
                                  ^~~~
3 errors generated.

So the test fails to compile, as expected. The error message is fairly
reasonable. Is this XFAILed because of QoI? Or would it make sense to
un-XFAIL this test with the appropriate changes?

By comparison, gcc emits:

prog.cpp:1:32: error: ‘T’ has not been declared
 template<typename T = typename T::type> struct X; // expected-error{{default}}

And MSVC requires a bit more coaxing (you have to actually instantiate
the struct to get the diagnostic), but eventually emits: error C2079:
'x' uses undefined struct 'X<Test>'

~Aaron




More information about the cfe-commits mailing list