2

while testing with different version of g++, the following problem came up

template<class bra>
struct Transform<bra, void> : kernel::Eri::Transform::bra {
        static const size_t ni = bra::A::size;

bra::A is interpreted as kernel::Eri::Transform::bra::A, rather than template argument by g++ 4.1.2. on the other hand, g++ 4.3 gets it right.

what should be correct behavior according to standard?

Meanwhile, I refactor slightly to make problem go away.

Georg Fritzsche
  • 97,545
  • 26
  • 194
  • 236
Anycorn
  • 50,217
  • 42
  • 167
  • 261

1 Answers1

4

Seems to me like gcc 4.1.2 was right. §14.6.1/7 (ISO/IEC 14882, C++03):

In the definition of a class template or in the definition of a member of such a template that appears outside of the template definition, for each base class which does not depend on a template-parameter (14.6.2), if the name of the base class or the name of a member of the base class is the same as the name of a template- parameter, the base class name or member name hides the template-parameter name (3.3.7).

Georg Fritzsche
  • 97,545
  • 26
  • 194
  • 236
  • thank you. can you provide me with a link to standard? I found April 19, 2000 rev. is it good enough (it does address this particular issue)? – Anycorn May 04 '10 at 17:23
  • @aaa: I was referring to C++03, there should be a final draft online. See here for links etc.: http://stackoverflow.com/questions/81656/where-do-i-find-the-current-c-or-c-standard-documents – Georg Fritzsche May 04 '10 at 17:26
  • I am always amazed when people are able to come up with the exact paragraph from the standard :p – Matthieu M. May 04 '10 at 17:28