I accidentally happened to find this in one of the source codes I was looking at. So, I\'m giving a similar smaller example here.
In the file test.h:
This code is not valid.
It was a bug in g++ that it accepted the code. See "g++ does not treat injected class name correctly." The bug was resolved as fixed in 2009, so it should be fixed in any recent version of g++.