[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / virtual-function-in-union.cpp
blobb7cf26618c9fb41e0b31c284b72f539f22efad0f
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 union U {
4 int d;
5 virtual int f() { return d; }; // expected-error {{unions cannot have virtual functions}}
6 };
8 int foo() { U u; return u.d; }