This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ RFC/Patch] PR c++/71665
- From: Jason Merrill <jason at redhat dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 28 Jul 2016 10:28:59 -0400
- Subject: Re: [C++ RFC/Patch] PR c++/71665
- Authentication-results: sourceware.org; auth=none
- References: <5773E0DC.9080105@oracle.com> <CADzB+2nSB-J_eRXyJ+a8dZSPGeJCDUFpq3+DdQKB2ZPBL-X3iw@mail.gmail.com> <22f2aee0-29d3-1c18-3871-291f08be4984@oracle.com> <CADzB+2nfHj8iFADmjNbP2KFTSwp0_7XZBvPOC=bmxUgA_zy9sA@mail.gmail.com> <11b0a778-116d-3249-f39a-75c022df4718@oracle.com>
On Thu, Jul 28, 2016 at 7:48 AM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> Ah sorry, I missed the *type* bit. The below passes testing on x86_64-linux.
> I don't think we need to check the type again after cxx_constant_value?!?
No, we don't. The patch is OK.
> While finally spending a decent amount of time on this issue I noticed that
> current clang appears to enforce integral or *unscoped* enumeration type and
> tweaking our code in the obvious way doesn't cause regressions, we of course
> reject earlier (ie, not as "could not convert ‘(E)1’ from ‘E’ to ‘unsigned
> int’") in build_enumerator snippets like:
>
> enum class E { e = 1 };
>
> class A
> {
> enum { a = E::e };
> };
Sure, that change could improve diagnostic quality a bit.
Jason