view gcc/testsuite/g++.dg/lto/odr-1_0.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

// PR c++/82414
// { dg-lto-do link }
enum vals {aa,cc}; // { dg-lto-warning "6: type 'vals' violates the C\\+\\+ One Definition Rule" }
struct a { // { dg-lto-warning "8: type 'struct a' violates the C\\+\\+ One Definition Rule" }
  struct b *ptr; // { dg-lto-message "13: the first difference of corresponding definitions is field 'ptr'" }
  enum vals vals;
};
void test(struct a *a)
{
  a->vals = cc;
}