view gcc/testsuite/g++.old-deja/g++.robertl/eb69.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-do assemble  }
// Test that g++ complains about referring to a builtin type in a
// mem-initializer.
// Contributed by Kevin Buhr <buhr@stat.wisc.edu>

int r = 0;

struct foo {		        // { dg-message "note" } candidate
  foo(int x) { r = 1; }		// { dg-message "note" }
};

struct bar : foo {
  typedef int an_int;
  bar() : bar::an_int(3) {}	// { dg-error "match" "match" } not a base
  // { dg-message "expected" "exp" { target *-*-* } .-1 }
};

int
main() {
  bar b;
  return r;
}