re PR c++/54442 (Const overloads resolution failure)

2014-06-09  Marc Glisse  <marc.glisse@inria.fr>

	PR c++/54442
gcc/
	* tree.c (build_qualified_type): Use a canonical type for
	TYPE_CANONICAL.
gcc/testsuite/
	* g++.dg/pr54442.C: New file.

From-SVN: r211377
This commit is contained in:
Marc Glisse 2014-06-09 17:07:24 +02:00 committed by Marc Glisse
parent 109a3af40f
commit 00f30445f4
4 changed files with 27 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2014-06-09 Marc Glisse <marc.glisse@inria.fr>
PR c++/54442
* tree.c (build_qualified_type): Use a canonical type for
TYPE_CANONICAL.
2014-06-09 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
* config/arm/arm-modes.def: Remove XFmode.

View File

@ -1,3 +1,8 @@
2014-06-09 Marc Glisse <marc.glisse@inria.fr>
PR c++/54442
* g++.dg/pr54442.C: New file.
2014-06-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/61406

View File

@ -0,0 +1,12 @@
/* { dg-do compile } */
struct S
{
void s (int) const throw ();
void s (int) throw ();
};
typedef int index_t;
void (S::*f) (index_t) = &S::s;
void (S::*g) (index_t) const = &S::s;

View File

@ -6326,8 +6326,10 @@ build_qualified_type (tree type, int type_quals)
else if (TYPE_CANONICAL (type) != type)
/* Build the underlying canonical type, since it is different
from TYPE. */
TYPE_CANONICAL (t) = build_qualified_type (TYPE_CANONICAL (type),
type_quals);
{
tree c = build_qualified_type (TYPE_CANONICAL (type), type_quals);
TYPE_CANONICAL (t) = TYPE_CANONICAL (c);
}
else
/* T is its own canonical type. */
TYPE_CANONICAL (t) = t;