re PR c++/49387 (t.cxx:140: error: too many initializers for ‘const __class_type_info_pseudo’)

PR c++/49387
	* rtti.c (get_pseudo_ti_index): Call complete_type.

From-SVN: r175743
This commit is contained in:
Jason Merrill 2011-06-30 20:53:10 -04:00 committed by Jason Merrill
parent 0bd96aad7a
commit 17d208b54e
4 changed files with 31 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2011-06-30 Jason Merrill <jason@redhat.com>
PR c++/49387
* rtti.c (get_pseudo_ti_index): Call complete_type.
PR c++/49569
* method.c (implicitly_declare_fn): Set DECL_PARM_LEVEL and
DECL_PARM_INDEX on rhs parm.

View File

@ -406,6 +406,8 @@ get_tinfo_decl (tree type)
type = build_function_type (TREE_TYPE (type),
TREE_CHAIN (TYPE_ARG_TYPES (type)));
type = complete_type (type);
/* For a class type, the variable is cached in the type node
itself. */
if (CLASS_TYPE_P (type))

View File

@ -1,5 +1,8 @@
2011-06-30 Jason Merrill <jason@redhat.com>
PR c++/49387
* g++.dg/rtti/template1.C: New.
PR c++/49569
* g++.dg/cpp0x/regress/ctor1.C: New.

View File

@ -0,0 +1,23 @@
// PR c++/49387
#include <typeinfo>
struct ResourceMonitorClient { };
template <typename T> struct ResourcePool : public ResourceMonitorClient {
virtual ~ResourcePool() { }
};
template <typename T> struct BaseWriter {
BaseWriter() {
typeid(ResourcePool<int>*);
}
virtual void run() {
ResourcePool<int> pool;
}
};
BaseWriter<void> b;