Commit 9c49a5e4 by Paolo Carlini Committed by Paolo Carlini

re PR c++/29928 (typeid of unknown bound array)

/cp
2007-05-14  Paolo Carlini  <pcarlini@suse.de>

	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  <pcarlini@suse.de>

	PR c++/29928
	* g++.dg/rtti/typeid5.C: New.

From-SVN: r124724
parent 49452c07
2007-05-14 Paolo Carlini <pcarlini@suse.de>
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).
2007-05-14 Rafael Avila de Espindola <espindola@google.com>
* cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
......
......@@ -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)
......
2007-05-14 Paolo Carlini <pcarlini@suse.de>
PR c++/29928
* g++.dg/rtti/typeid5.C: New.
2007-05-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/31725
// PR c++/29928
// { dg-do compile }
#include <typeinfo>
struct S;
void f()
{
const std::type_info& info1 = typeid(int []);
const std::type_info& info2 = typeid(S [3]);
const std::type_info& info3 = typeid(S []);
}
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