From: Aldy Hernandez Date: Tue, 24 Jan 2012 16:47:24 +0000 (+0000) Subject: + PR c++/51928 + * class.c (set_method_tm_attributes): Use TARGET_THUNK instead... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=00a42fb364bba1a8cea3e36c15969d7fbc10a1fe;p=gcc.git + PR c++/51928 + * class.c (set_method_tm_attributes): Use TARGET_THUNK instead... + PR c++/51928 + * class.c (set_method_tm_attributes): Use TARGET_THUNK instead of + thunk for set_one_vmethod_tm_attributes. Co-Authored-By: Patrick Marlier From-SVN: r183478 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9eb975d43b5..6dbb4333f3d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2012-01-24 Aldy Hernandez + Patrick Marlier + + PR c++/51928 + * class.c (set_method_tm_attributes): Use TARGET_THUNK instead of + thunk for set_one_vmethod_tm_attributes. + 2012-01-24 Paolo Carlini PR c++/51223 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index d654b7604c6..35e0864e256 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -4430,7 +4430,12 @@ set_method_tm_attributes (tree t) tree vchain; for (vchain = BINFO_VIRTUALS (TYPE_BINFO (t)); vchain; vchain = TREE_CHAIN (vchain)) - set_one_vmethod_tm_attributes (t, BV_FN (vchain)); + { + fndecl = BV_FN (vchain); + if (DECL_THUNK_P (fndecl)) + fndecl = THUNK_TARGET (fndecl); + set_one_vmethod_tm_attributes (t, fndecl); + } } /* If the class doesn't have an attribute, nothing more to do. */ diff --git a/gcc/testsuite/g++.dg/tm/pr51928.C b/gcc/testsuite/g++.dg/tm/pr51928.C new file mode 100644 index 00000000000..22dbadd4bf5 --- /dev/null +++ b/gcc/testsuite/g++.dg/tm/pr51928.C @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-fgnu-tm" } */ + +struct A; // { dg-error "forward declaration of 'struct A'" } + +struct B +{ + virtual B* foo(A); +}; + +struct C : virtual B +{ + virtual C* foo(A) { return 0; } // { dg-error "'' has incomplete type" } +}; + +C c;