Illegal explicit template specialization accepted

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])
 
C

Carl Daniel [VC++ MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top