From 9c49a5e4b3295ed1376f0457cc6178aa2f95cd60 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 14 May 2007 20:21:34 +0000 Subject: re PR c++/29928 (typeid of unknown bound array) /cp 2007-05-14 Paolo Carlini PR c++/29928 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the type only if is a class type (5.2.8/4). /testsuite 2007-05-14 Paolo Carlini PR c++/29928 * g++.dg/rtti/typeid5.C: New. From-SVN: r124724 --- gcc/cp/rtti.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/cp/rtti.c') diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 121699f..1891f3b 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -238,7 +238,7 @@ get_tinfo_decl_dynamic (tree exp) /* Peel off cv qualifiers. */ type = TYPE_MAIN_VARIANT (type); - if (!VOID_TYPE_P (type)) + if (CLASS_TYPE_P (type)) type = complete_type_or_else (type, exp); if (!type) @@ -431,7 +431,7 @@ get_typeid (tree type) that is the operand of typeid are always ignored. */ type = TYPE_MAIN_VARIANT (type); - if (!VOID_TYPE_P (type)) + if (CLASS_TYPE_P (type)) type = complete_type_or_else (type, NULL_TREE); if (!type) -- cgit v1.1