mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-14 06:50:27 +08:00
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
This commit is contained in:
parent
49452c070f
commit
9c49a5e4b3
@ -1,3 +1,9 @@
|
||||
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)
|
||||
|
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
13
gcc/testsuite/g++.dg/rtti/typeid5.C
Normal file
13
gcc/testsuite/g++.dg/rtti/typeid5.C
Normal file
@ -0,0 +1,13 @@
|
||||
// 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 []);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user