https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86922
Richard Biener changed:
What|Removed |Added
Keywords||diagnostic, wrong-code
--- Comment #1 from Richard Biener ---
It warns about dereferencing
(int (*) () * *) &((const struct B *) obj)->D.2305
which is built via
#2 0x00b585af in cp_build_indirect_ref_1 (
ptr=, errorstring=RO_NULL, complain=3,
do_fold=true) at /tmp/trunk/gcc/cp/typeck.c:3155
#3 0x00b58938 in cp_build_fold_indirect_ref (
pointer=) at /tmp/trunk/gcc/cp/typeck.c:3232
#4 0x00b59a5e in get_member_function_from_ptrfunc (
instance_ptrptr=0x7fffc868, function=,
complain=3) at /tmp/trunk/gcc/cp/typeck.c:3565
#5 0x0097aabd in build_offset_ref_call_from_tree (
fn=, args=0x7fffc958, complain=3)
at /tmp/trunk/gcc/cp/decl2.c:5095
#6 0x00ab9d26 in tsubst_copy_and_build (t=,
args=, complain=3,
in_decl=, function_p=false,
integral_constant_expression_p=false) at /tmp/trunk/gcc/cp/pt.c:18485
the fnptr type has an alias-set that isn't compatible with that of struct B.
Not sure where that int return type comes from ...
Fishy. And possibly wrong-code afterwards because of that alias set.