This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] PR c++/26256
- From: Fabien Chêne <fabien dot chene at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 15 Jun 2011 19:58:10 +0200
- Subject: Re: [Patch] PR c++/26256
- References: <AANLkTikY4pcci892bD0M2MsbakFvrK4r15csPFSLT5nO@mail.gmail.com> <4C0EB10C.3050701@redhat.com> <AANLkTimONzSNNiUarwu1vU1AhiTUf2Ug_mKJE4Ya2LXj@mail.gmail.com> <4C1AD953.3020008@redhat.com> <AANLkTikL5DwqQd2egQzgwUngEc+NtYax-jdpaQrp0p+-@mail.gmail.com> <AANLkTinuzT8Umh0NF3Nbx2r70TYqeK5UP54qnRuHYcBq@mail.gmail.com> <4C6E0571.3070802@redhat.com> <AANLkTi=38qQdh-BzrFTJ5uHDH_F+sctb+iJAinKuMC3k@mail.gmail.com> <AANLkTi=RB6sn_ic5Pb30yxkjn0VMME5y8ZK9k5VMGRDK@mail.gmail.com> <AANLkTin5FvEzTYUg+W5bRzk462LaJ4hpk3s+yxZzF_RY@mail.gmail.com> <AANLkTinjj2vPrOkbE0qK1ht7YwxwQmXFhPnGPSvVQNgw@mail.gmail.com> <4D1279FD.6010706@redhat.com> <AANLkTinkB+iwTHZXngtOa88rgBScyrMK2R9p7H5yCbrj@mail.gmail.com> <4D7297F5.2000708@redhat.com> <AANLkTimbWH16eyQGhxAMiCO+CnVQdRAi4V0U7=hAfv_6@mail.gmail.com>
Hi,
After updating the patch, I now see a failure on c++0x forward enums.
Consider the below code:
template <class T>
struct S1
{
enum class E1;
enum class E1;
};
Currently, the second declaration of E1 relies on a successfull call
to supplement_binding_1.
With the patch I am working on, it no longer succeeds, because a new
check is needed, in order to fail if (target_)bval is a type (nearly
similar to the fix for c++/48010).
if (TREE_CODE (target_decl) == TYPE_DECL && DECL_ARTIFICIAL (target_decl)
&& (TREE_CODE (target_bval) != TYPE_DECL
I don't really see a good solution to make it work.
As I already did for c++/48010, we can add the below check...
|| same_type_p (TREE_TYPE (target_decl), TREE_TYPE (target_bval)
But, same_type_p does not returns true, and it seems difficult to make
it return true because the underlying type of the DECL is not yet set
when calling pushtag1 in start_enum.
Otherwise, perhaps that it would be better if the second declaration
of E1 does not rely on supplement_binding_1.
What do you think ?
--
Fabien