Commit efcc9293 by Jason Merrill Committed by Jason Merrill

re PR c++/51565 (fastcall in array of method pointers: internal compiler error)

	PR c++/51565
	* call.c (standard_conversion): For ptrmemfuncs, compare the
	static_fn_types.

From-SVN: r183120
parent 00733a00
2012-01-11 Jason Merrill <jason@redhat.com> 2012-01-11 Jason Merrill <jason@redhat.com>
PR c++/51565
* call.c (standard_conversion): For ptrmemfuncs, compare the
static_fn_types.
PR c++/51818 PR c++/51818
* mangle.c (find_substitution): A type is only a substitution * mangle.c (find_substitution): A type is only a substitution
match if we're looking for a type. match if we're looking for a type.
......
...@@ -1274,10 +1274,8 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p, ...@@ -1274,10 +1274,8 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
tree tbase = class_of_this_parm (tofn); tree tbase = class_of_this_parm (tofn);
if (!DERIVED_FROM_P (fbase, tbase) if (!DERIVED_FROM_P (fbase, tbase)
|| !same_type_p (TREE_TYPE (fromfn), TREE_TYPE (tofn)) || !same_type_p (static_fn_type (fromfn),
|| !compparms (TREE_CHAIN (TYPE_ARG_TYPES (fromfn)), static_fn_type (tofn)))
TREE_CHAIN (TYPE_ARG_TYPES (tofn)))
|| cp_type_quals (fbase) != cp_type_quals (tbase))
return NULL; return NULL;
from = build_memfn_type (fromfn, tbase, cp_type_quals (tbase)); from = build_memfn_type (fromfn, tbase, cp_type_quals (tbase));
......
2012-01-11 Jason Merrill <jason@redhat.com>
PR c++/51565
* g++.dg/ext/attrib42.C: New.
2012-01-11 Jakub Jelinek <jakub@redhat.com> 2012-01-11 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/51796 PR bootstrap/51796
......
// { dg-do compile { target i?86-*-* } }
struct A {
__attribute__((fastcall))
void f();
};
int main()
{
typedef void (A::*FP)();
FP fp[] = {&A::f}; // { dg-error "cannot convert" }
}
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