home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 32,028 of 33,346   
   =?ISO-8859-1?Q?Daniel_Kr=FCgler?= to All   
   Re: Base class as friend for derived   
   19 Mar 12 22:02:18   
   
   39ee1b68   
   From: daniel.kruegler@googlemail.com   
      
   Am 18.03.2012 13:07, schrieb VladislavKurmaz:   
   > Here is minimal example, that tries to declare base class as friend   
   > for derived.   
   >   
   > template   
   > class base   
   > {   
   > };   
   >   
   > class derived : public base<  derived>   
   > {   
   > 	template<  class U>  friend class base;   
   > };   
   >   
   > msvc11/msvc10/msvc9/Comeau-online process this code withou any errors   
   > or warnings, but gcc-4.5.3(cygwin) : generate next message "error:   
   > specialization of 'base' after instantiation"   
   >   
   > Is it correct code from C++ standard perspective?   
      
   I'm pretty sure that this must be a compiler defect and opened an issue   
   for it (The error still exists in gcc 4.8):   
      
   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52625   
      
   HTH & Greetings from Bremen,   
      
   Daniel Krügler   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca