www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/03/01/09:30:13.1

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: Bernd F <NOSilverbananaSPAM AT gmx DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problem namespaces,templates & friends
Date: Fri, 01 Mar 2002 15:26:37 +0100
Organization: T-Online
Lines: 58
Message-ID: <3C7F8F9D.31E2B058@gmx.de>
References: <3C7F8DE2 DOT 9B3133EF AT gmx DOT de>
Mime-Version: 1.0
X-Trace: news.t-online.com 1014992804 00 27094 HBktT-nGSOAOKb 020301 14:26:44
X-Complaints-To: abuse AT t-online DOT com
X-Sender: 520041811770-0001 AT t-dialin DOT net
X-Mailer: Mozilla 4.79 [en] (Win98; U)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com


Bernd F wrote:
> 
> Hi!
> 
> Can someone tell me, why this code doesn't compile?
> 
> //------------------------snip----------------------
> namespace NspcA
> {
> namespace NspcB
> {
> template <class TempPar1, int TempPar2>
> class TBeta;
> } // of namespace NspcB
> 
> template <class TempPar1, int TempPar2>
> class TAlpha
> {
> /* Line A: compiles
> */
> 
> //      friend class NspcB::TBeta<TempPar1,TempPar2>;
> /* Line B: doesn't compile with error:
>                                    parse error before `;' token
> */
>         friend class ::NspcA::NspcB::TBeta<TempPar1,TempPar2>;
> };
> namespace NspcB
> {
> template <class TempPar1, int TempPar2>
> class TBeta
> {
> };
> } // of namespace NspcB
> } // of namespace NspcA
> 
> int main()
> {
>         return 0;
> }
> //------------------------snip----------------------
> 
> When I uncomment line A and comment line B out it compiles perfectly.
> Why does the way I address namespaces (absolute vs relative) influence
> wether it compiles or not? Is it a compiler bug? If so: Is it known
> and/or is there some way to fix it?
> 
> Compiler info:
> GNU CPP version 3.0.3 (cpplib) (80386, BSD syntax)
> GNU C++ version 3.0.3 (djgpp)
> 
> Thanks for any help in advance!
> 
> Bernd F.

Just upgraded to 3.0.4 (both, gcc&gpp), same problem persists!

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019