(Sorry, pressed return to early...) g++ accepts the following code, which contains a typedef that's supposed to act as a static assert. ------------------------------------------------------------------------------- template<int N> struct Test { Test() { typedef struct StaticAssert {unsigned condition : (N); } XXX; } }; int main() { Test<0> T; } -------------------------------------------------------------------------------
Confirmed. The typedef is only rejected if it is actually used to define a variable. W.
Also fixed for 4.8.0. I'm adding the test and closing the PR.
Done.