if (do_warning != -1 || j >= this_enum.vals.length ())
continue;
if (strcmp (id, this_enum.vals[j].name)
+ || (val.get_precision() !=
+ this_enum.vals[j].val.get_precision())
|| val != this_enum.vals[j].val)
{
warn_name = xstrdup (id);
"name %qs differs from name %qs defined"
" in another translation unit",
this_enum.vals[j].name, warn_name);
+ else if (this_enum.vals[j].val.get_precision() !=
+ warn_value.get_precision())
+ inform (this_enum.vals[j].locus,
+ "name %qs is defined as %u-bit while another "
+ "translation unit defines it as %u-bit",
+ warn_name, this_enum.vals[j].val.get_precision(),
+ warn_value.get_precision());
/* FIXME: In case there is easy way to print wide_ints,
perhaps we could do it here instead of overflow check. */
else if (wi::fits_shwi_p (this_enum.vals[j].val)
--- /dev/null
+/* { dg-lto-do link } */
+
+enum A : __UINT32_TYPE__ { // { dg-lto-warning "6: type 'A' violates the C\\+\\+ One Definition Rule" }
+ a, // { dg-lto-note "3: name 'a' is defined as 32-bit while another translation unit defines it as 64-bit" }
+ b,
+ c
+};
+
+int main()
+{
+ return (int) A::a;
+}