This works in GCC and Comeau:
struct X {}; void X() {}
This happens in Como:
struct X {}; template< typename T > void X() {}
This interrupts both:
template< typename T > struct X {}; template< typename T > void X() {}
The rule is defined in clause 3.3.7 / 2. Is the mismatch simply because the function template is not a function? I can not understand the behavior of GCC.
The class name (9.1) or enumeration name (7.2) can be hidden by the variable name, data member, function, or enumerator declared in the same scope. If the class or enumeration name and variable, data member, function, or enumerator are declared in the same scope (in any order) with the same name, the class or enumeration name is hidden wherever the variable, data member, function, or counter name is visible.
source share