This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/pt.c mixing-up inner/outer template args
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Re: c++/pt.c mixing-up inner/outer template args
- From: Larry Evans <jcampbell3 at prodigy dot net>
- Date: Wed, 20 Dec 2000 09:39:43 -0600
- References: <3A3FD60F.EDC3B2BD@prodigy.net>
Larry Evans wrote:
...skipping
> -------------------
> /mnt/scratch/gcc-2.96/latest-cvs/bug417-patch/install/bin/g++ -c main.cpp
>
> :arg not a TYPE_P=
> <integer_cst 0x2ac0a860 type <enumeral_type 0x2ac0b780 OffRoot> constant 2>
> t=
> <template_type_parm 0x2ac10e00 TOP_ELEM VOID
> align 8 symtab 0 alias set 0
> index 1 level 1 orig_level 1
> chain <type_decl 0x2ac10e80 TOP_ELEM>>
> levels=1, level=1, veclen=2
> arg[0]=
> <record_type 0x2ac17c80 SubjTop_test type_1 type_5 QI
> size <integer_cst 0x2abf5400 type <integer_type 0x2abfa380 bit_size_type> constant 8>
> unit size <integer_cst 0x2abf5f00 type <integer_type 0x2abfa300 unsigned int> constant 1>
> user align 8 symtab 0 alias set -1
> fields <type_decl 0x2ac17e00 SubjTop_test type <record_type 0x2ac17c80 SubjTop_test>
> nonlocal VOID file main.cpp line 114
> align 1 context <record_type 0x2ac17c80 SubjTop_test>
> >
> X() X(constX&) this=(X&) n_parents 0 use_template=0 interface-unknown vtable-needs-writing
> member-functions <tree_vec 0x2ac19600
> elt 0 <overload 0x2ac0e750>
> elt 2 <function_decl 0x2ac1a680 operator=>
> elt 3 <overload 0x2ac0e7d0>
> elt 4 <overload 0x2ac0e7a0>>
> pointer_to_this <pointer_type 0x2ac17d00> reference_to_this <reference_type 0x2ac1a480> chain <type_decl 0x2ac17d80 SubjTop_test>>
> arg[1]=
> <integer_cst 0x2ac0a860 type <enumeral_type 0x2ac0b780 OffRoot> constant 2>
I should have mentioned that the above output is produced by some debug prints
which I added to pt.c. I'm sorry for any confusion this may have caused.
The diff output for the changes follows:
---------------------------------------------------
*** /tmp/pt.c Wed Dec 20 09:33:54 2000
--- /tmp/pt.c580Kci Wed Dec 20 09:33:54 2000
***************
*** 6307,6312 ****
--- 6307,6331 ----
{
if (TREE_CODE (t) == TEMPLATE_TYPE_PARM)
{
+ if (!TYPE_P (arg))
+ {
+ fprintf (stdout, "\n:arg not a TYPE_P=\n");
+ debug_tree (arg);
+ fprintf (stdout, "t=\n");
+ debug_tree (t);
+ {
+ int i = 0;
+ int n = TREE_VEC_LENGTH (args);
+ fprintf (stdout, "levels=%d, level=%d, veclen=%d\n", levels, level, n);
+ for(; i<n; ++i)
+ {
+ tree argi = TMPL_ARG (args, level, i);
+ fprintf (stdout, "arg[%d]=\n", i);
+ debug_tree (argi);
+ }
+ }
+ fflush (stdout);
+ }
my_friendly_assert (TYPE_P (arg), 0);
return cp_build_qualified_type_real
(arg, CP_TYPE_QUALS (arg) | CP_TYPE_QUALS (t),