diff options
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/rtti.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/rtti/template1.C | 23 |
4 files changed, 31 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e3f98455c37..ad6cd0355e1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 0feaf07f851..53404b4a62d 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -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)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 382e0981a70..7715ae0e32e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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. diff --git a/gcc/testsuite/g++.dg/rtti/template1.C b/gcc/testsuite/g++.dg/rtti/template1.C new file mode 100644 index 00000000000..e2a03766fbb --- /dev/null +++ b/gcc/testsuite/g++.dg/rtti/template1.C @@ -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; |