Commit 4552f5a2 by Douglas Gregor Committed by Doug Gregor

re PR c++/33601 (ICE with pointers to members using "const C" as the class identifier)

2007-10-26  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/33601
	* tree.c (build_offset_type): Build canonical type based on the
	TYPE_MAIN_VARIANT of the base type.

2007-10-26  Douglas Gregor  <doug.gregor@gmail.com>

	* g++.dg/other/pr33601.C: New.

From-SVN: r129659
parent 84f2b1d1
2007-10-26 Douglas Gregor <doug.gregor@gmail.com>
PR c++/33601
* tree.c (build_offset_type): Build canonical type based on the
TYPE_MAIN_VARIANT of the base type.
2007-10-26 Daniel Jacobowitz <dan@codesourcery.com> 2007-10-26 Daniel Jacobowitz <dan@codesourcery.com>
* reorg.c (emit_delay_sequence): Move insn locator from the * reorg.c (emit_delay_sequence): Move insn locator from the
2007-10-26 Douglas Gregor <doug.gregor@gmail.com>
* g++.dg/other/pr33601.C: New.
2007-10-26 Paolo Carlini <pcarlini@suse.de> 2007-10-26 Paolo Carlini <pcarlini@suse.de>
PR c++/31988 PR c++/31988
struct A
{
int membervar;
};
typedef const A type;
int type::* getmemberptr() { return &type::membervar; }
...@@ -5949,10 +5949,10 @@ build_offset_type (tree basetype, tree type) ...@@ -5949,10 +5949,10 @@ build_offset_type (tree basetype, tree type)
if (TYPE_STRUCTURAL_EQUALITY_P (basetype) if (TYPE_STRUCTURAL_EQUALITY_P (basetype)
|| TYPE_STRUCTURAL_EQUALITY_P (type)) || TYPE_STRUCTURAL_EQUALITY_P (type))
SET_TYPE_STRUCTURAL_EQUALITY (t); SET_TYPE_STRUCTURAL_EQUALITY (t);
else if (TYPE_CANONICAL (basetype) != basetype else if (TYPE_CANONICAL (TYPE_MAIN_VARIANT (basetype)) != basetype
|| TYPE_CANONICAL (type) != type) || TYPE_CANONICAL (type) != type)
TYPE_CANONICAL (t) TYPE_CANONICAL (t)
= build_offset_type (TYPE_CANONICAL (basetype), = build_offset_type (TYPE_CANONICAL (TYPE_MAIN_VARIANT (basetype)),
TYPE_CANONICAL (type)); TYPE_CANONICAL (type));
} }
......
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