Great question, Stackoverflow community would love it.
I may be wrong, but I think that compilation fails because at line 3, the class Test is not yet complete, which, in turn must mean the class Test::Sub is not complete in some sense (although I am not sure about it), which in turn means that the constructor Test::Sub::Sub(int) is declared, but not defined.
The last part is based on what clang++ tells me:
undefined constructor 'Sub' cannot be used in a constant
expression
test.cc:12:14: note: declared here
struct Sub{constexpr Sub(int i){}};
^
Tks.
I've been trying to use constexpr to build compile-time structures and I got quite confused with that error. It cost me hours to come up with that simple statement to show where the error came from...
:(
I went through the post-c++ 11 proposal. Unfortunately, I couldn't find any information about that error ...