Mail Archives: djgpp/2002/03/01/09:30:13.1
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 -