1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 
3 union U {
4   int d;
f()5   virtual int f() { return d; }; // expected-error {{unions cannot have virtual functions}}
6 };
7 
foo()8 int foo() { U u; return u.d; }
9