Illegal explicit template specialization accepted

  • Thread starter Thread starter Hendrik Schober
  • Start date Start date
H

Hendrik Schober

Hi,

both Comeau and CW9 complain about the following
code. VC71 accepts it. I cannot cite chapter and
verse of the standard disallowing this, but I
usually believe what Comeau says.
Is that a known issue?

template<int id> struct X;

template<> struct X<42> {
template< typename U > struct Y;
template<> struct Y<int> {}; // illegal
};

Schobi

--
(e-mail address removed) is never read
I'm Schobi at suespammers org

"My hair style calls into immediate question all my judgements."
Scott Meyers
(http://www.google.de/[email protected])
 
Hendrik said:
Hendrik Schober said:
[...] I cannot cite chapter and
verse of the standard disallowing this, but I
usually believe what Comeau says.

OK. I think that 14.7.3./2 would prevent that
from beeing legal. (Thanks to the guys in the
Borland newsgroups!)
Agreed.
Is that a known issue?

template<int id> struct X;

template<> struct X<42> {
template< typename U > struct Y;
template<> struct Y<int> {}; // illegal
};

Now, what about this?

It's a bug. I'll make sure someone from the VC team sees it.

-cd
 
Back
Top