Commit a91db711 by Nathan Sidwell

re PR c++/11596 (ICE with int templates)

cp:
	PR c++/11596
	* pt.c (maybe_fold_nontype_arg, maybe_fold_nontype_args): Remove.
	(tsubst_template_arg): New.
	(tsubst_template_arg_vector): Rename to ...
	(tsubst_template_args): ... this. Accept a TREE_LIST form. Use
	tsubst_template_arg.
	(coerce_template_parms): Use tsubst_template_arg for default
	value.
	(tsubst_template_parms): Likewise.
	(tsubst_aggr_type): Adjust.
	(tsubst_decl): Likewise.
	(tsubst): Use tsubst_template_arg for a DOMAIN. Adjust.
	(tsubst_copy) <TEMPLATE_ID_EXPR case>: Use tsubst_template_args.
testsuite:
	PR 11596
	* g++.dg/template/defarg3.C: New test.

	* g++.dg/ext/packed2.C: Pack member struct too. Explain why.

From-SVN: r69776
parent b6fe0bb8
2003-07-25 Nathan Sidwell <nathan@codesourcery.com>
PR c++/11596
* pt.c (maybe_fold_nontype_arg, maybe_fold_nontype_args): Remove.
(tsubst_template_arg): New.
(tsubst_template_arg_vector): Rename to ...
(tsubst_template_args): ... this. Accept a TREE_LIST form. Use
tsubst_template_arg.
(coerce_template_parms): Use tsubst_template_arg for default
value.
(tsubst_template_parms): Likewise.
(tsubst_aggr_type): Adjust.
(tsubst_decl): Likewise.
(tsubst): Use tsubst_template_arg for a DOMAIN. Adjust.
(tsubst_copy) <TEMPLATE_ID_EXPR case>: Use tsubst_template_args.
2003-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net> 2003-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
* Make-lang.in (cp/error.o): Depend on DIAGNOSTIC_H. * Make-lang.in (cp/error.o): Depend on DIAGNOSTIC_H.
* error.c: Use the new pretty-printer fraamework. * error.c: Use the new pretty-printer framework.
2003-07-24 Per Bothner <pbothner@apple.com> 2003-07-24 Per Bothner <pbothner@apple.com>
* decl.c (pushdecl_class_level): Don't use push_srcloc/pop_srcloc * decl.c (pushdecl_class_level): Don't use push_srcloc/pop_srcloc
which causes errors messages to incorrectly mention included files. which causes errors messages to incorrectly mention included files.
2003-07-24 Mark Mitchell <mark@codesourcery.com> 2003-07-24 Mark Mitchell <mark@codesourcery.com>
......
2003-07-25 Nathan Sidwell <nathan@codesourcery.com>
PR 11596
* g++.dg/template/defarg3.C: New test.
* g++.dg/ext/packed2.C: Pack member struct too. Explain why.
2003-07-24 Mark Mitchell <mark@codesourcery.com> 2003-07-24 Mark Mitchell <mark@codesourcery.com>
* g++.dg/inherit/access5.C: New test. * g++.dg/inherit/access5.C: New test.
......
// PR c++/10091 // PR c++/10091
// Original synopsis
// Bug: We were dying because in general, B::a doesn't have enough // Bug: We were dying because in general, B::a doesn't have enough
// alignment for us to take its address. But if the B is C::b, it does // alignment for us to take its address. But if the B is C::b, it does
// have enough alignment, and we should be able to determine that. // have enough alignment, and we should be able to determine that.
// This only failed on STRICT_ALIGNMENT targets (i.e. not i686) // This only failed on STRICT_ALIGNMENT targets (i.e. not i686)
// July 2003
// packing of non-pods is now only allowed if the non-pod is itself
// packed. Also only such pods can be reference bound to non-consts
struct A { struct A {
int i; int i;
A(); A();
A(const A&); A(const A&);
A& operator=(const A&); A& operator=(const A&);
}; } __attribute__ ((packed));
struct B { struct B {
A a; A a;
...@@ -23,8 +28,8 @@ struct C { ...@@ -23,8 +28,8 @@ struct C {
int j; int j;
}; };
void f (const A&); void f (A&);
void g (const C& c) void g (C& c)
{ {
f (c.b.a); f (c.b.a);
} }
// { dg-do compile }
// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 22 Jul 2003 <nathan@codesourcery.com>
// PR c++ 11596
template <int V, bool F = V < 1> struct A { enum { value }; };
template <int V> struct B { enum { value = A<1>::value }; };
int ary[!B<1>::value ? 1 : -1];
template <int V, bool F = V < 1> struct A1 { enum { value = 1}; };
template <int V> struct A1<V,false> { enum { value}; };
template <int V> struct B1 { enum { value = A1<1>::value }; };
int ary1[!B1<1>::value ? 1 : -1];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment