Issue |
130160
|
Summary |
[clang][rejects-valid] not finding partial specialization of nested class template
|
Labels |
clang
|
Assignees |
|
Reporter |
ericniebler
|
the following valid code does not compile on any version of clang i have tested, including trunk:
```c++
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
```
demo:
https://godbolt.org/z/8rvKqqWhM
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs