Closed
Description
the following valid code does not compile on any version of clang i have tested, including trunk:
template <class I>
struct Outer
{
template <I X, I Y>
struct Inner;
};
Outer<int> e2; // <== need to instantiate the outer template here
template <class I>
template <I Y>
struct Outer<I>::Inner<0, Y> {};
constexpr Outer<int>::Inner<0, 4> e{}; // <== type incomplete here
the error is:
<source>:15:35: error: constexpr variable cannot have non-literal type 'const Outer<int>::Inner<0, 4>'
constexpr Outer<int>::Inner<0, 4> e{};
^
<source>:15:35: error: implicit instantiation of undefined template 'Outer<int>::Inner<0, 4>'
<source>:6:10: note: template is declared here
struct Inner;
^
2 errors generated.
Compiler returned: 1