Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2004

Tip: Looking for answers? Try searching our database.

Suspected parser bug in VC7.1

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hendrik Schober - 06 May 2004 16:25 GMT
Hi,

For this

   template< typename T >
   struct X {
     void f(X) {}
   };

   template< typename T >
   struct Y : public X<Y>{
     void f(Y) {}
   };

   int main()
   {
     Y<int> y;
     return 0;
   }

code, which VC7.1 accepts, Comeau says

   "ComeauTest.c", line 7: error: argument list for class template "Y" is missing
     struct Y : public X<Y>{
                         ^

and CW9 doesn't like it either.
I'm pretty sure 'Y' can be used in place of
'Y<T>' only after the opening { -- However,
while I'm sure the standard specifies this
somewhere, everytime I look into this I feel
like I can't read...

So I suspect this is a bug VC7.1.

Schobi

P.S.: Now, let me guess... OK... according to
     how this usually goes, Carl will pick it
     up, check it against Whidbey (sorry, but
     I don't have a spare machine and it blew
     my VC7.1 installation when I tried side-
     by-side with VC7.1), and say either that
     this is fixed in Whidbey, or that he will
     report it (TIA!), although there is not
     much hope that it will be fixed too soon
     because accepting illegal code doesn't
     get a very high priority...
     Am I right? :)

Signature

SpamTrap@gmx.de is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
 Scott Meyers

Carl Daniel [VC++ MVP] - 06 May 2004 17:32 GMT
> P.S.: Now, let me guess... OK... according to
>       how this usually goes, Carl will pick it
[quoted text clipped - 8 lines]
>       get a very high priority...
>       Am I right? :)

Exactly so.  I get the same behavior with Whidbey.

As for whether it's illegal, I too was unable to find anything very explicit
in the standard (including TC1) that clearly says that VC is wrong, but I
think it follows from 14.6.1, 10.2 and 3.3.6 that the injected class name
isn't visible in the base class list, so the name must include the template
arguments at that point.

I'll go ahead and submit a bug report - and yes, it'll get a low priority
assigned to it.

-cd
Hendrik Schober - 07 May 2004 11:47 GMT
> [...]
> >       Am I right? :)
>
> Exactly so. [...]

 :o>

> I'll go ahead and submit a bug report [...]

 Thanks again, Carl!

> -cd

 Schobi

Signature

SpamTrap@gmx.de is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
 Scott Meyers


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.