aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaCXX/virtual-function-in-union.cpp
blob: b7cf26618c9fb41e0b31c284b72f539f22efad0f (plain)
1
2
3
4
5
6
7
8
// RUN: %clang_cc1 -fsyntax-only -verify %s

union U {
  int d;
  virtual int f() { return d; }; // expected-error {{unions cannot have virtual functions}}
};

int foo() { U u; return u.d; }