This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ patch] PR 20420


Hi again,

On 08/22/2012 05:13 PM, Jason Merrill wrote:
On 08/22/2012 10:55 AM, Paolo Carlini wrote:
. thus, in short, what is happening is that, for this testcase:

class B
{
protected:
   enum E { E1, E2, E3 };
};

class D : private B
{
public:
   using B::E;

private:
   enum E { };
};

we parse the new declaration enum E { }; and we reach
supplement_binding_1 before setting the underlying type of the new
declaration. The old declaration is fine, would not ICE
dependent_type_p.
So with your change would we still ICE if D were a template?  It seems
like what we should be checking for is null underlying type.

In the meanwhile, I tried to actually write a patch doing away with the processing_template_decl check but failed.


The problem is: if, as in the below patch "3", I don't call dependent_type_p when the underlying type is null and the check overall fails, I see regressions for testcases like forw_enum7.C, because when templates are involved we actually want to call dependent_type_p and return true; if, as in the below "4", a null underlying type means that overall the check succeeds, then we don't error out anymore for the new testcases, we don't ICE but we don't have the diagnostics either.

I see the outcome of these experiments as an indication that we want the processing_template_decl check...

Paolo.

//////////////////////

Attachment: patch_20420_3
Description: Text document

Attachment: patch_20420_4
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]