view gcc/testsuite/g++.dg/lto/odr-1_1.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
line wrap: on
line source

namespace {
  struct b; // { dg-lto-message "type 'struct b' defined in anonymous namespace cannot match across the translation unit boundary" }
 }
enum vals {aa,bb,cc}; // { dg-lto-message "an enum with different value name is defined in another translation unit" }
struct a { // { dg-lto-message "a different type is defined in another translation unit" }
  struct b *ptr; // { dg-lto-message "a field of same name but different type is defined in another translation unit" }
  enum vals vals;
} a;
void test(struct a *);
int
main(void)
{
  test (&a);
  if (a.vals==aa)
    return 1;
}