On Thu, Jul 28, 2016 at 7:48 AM, Paolo Carlini <paolo.carl...@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