This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re:nested template misclassified
- To: bug-gcc at gnu dot org
- Subject: Re:nested template misclassified
- From: Larry Evans <cppljevans at earthlink dot net>
- Date: Wed, 31 May 2000 20:13:49 -0500
Included below is a much simplified version of the problem I posted on
26 May. The problem does not occur when B is a namespace is used,
but does occur when B is a struct.
I've looked at the code in pt.c and decl.c for several days now and
cannot figure how to solve this problem. I'd appreciate any more
documentation (than that in source code)on how the tree data
structure (in gcc/tree.h and gcc/cp/cp-tree.h) works.
----------------- cut here --------------------
cd /home/evansl/prog_dev/gcc_all/gcc-2.96/tests/CurryTmpl/
make -k bugrep
uname -a
Linux localhost.localdomain 2.2.13-4mdk #1 Tue Sep 7 18:23:11 CEST 1999
i586 unknown
g++ -v
Reading specs from
/home/evansl/prog_dev/gcc_all/dist/lib/gcc-lib/i586-pc-linux-gnu/2.96/specs
gcc version 2.96 20000520 (experimental)
cat NvsS.cpp
//Purpose:
// Test to demonstrate Namespace vs. Struct def of templates
//Result:
// With #define STRUCT_B, get Compile-time error:
// `C' is not a template
// Otherwise, get no error.
template
< template<typename S>class T
>
struct
A
{ T<int> m_t;
};
//#define STRUCT_B
#ifdef STRUCT_B
struct
#else
namespace
#endif
B
{
template
< typename V
>
struct
C
{ V m_v;
};
};
A
<B
::C
>
z
;
../../bin/g++ -c NvsS.cpp
../../bin/g++ -c -DSTRUCT_B NvsS.cpp
NvsS.cpp: In instantiation of `A<B::C>':
NvsS.cpp:35: instantiated from here
NvsS.cpp:12: `C' is not a template***
make: *** [compile] Error 1
make: Target `bugrep' not remade because of errors.
Compilation exited abnormally with code 2 at Wed May 31 13:05:44