Sign in
rust
/
rust-lang
/
llvm-project
/
af8f9eb61a2ad4ee1f2d3f46d157b93a47c6a4bf
/
.
/
clang
/
test
/
SemaCXX
/
virtual-function-in-union.cpp
blob: b7cf26618c9fb41e0b31c284b72f539f22efad0f [
file
] [
log
] [
blame
]
// 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
;
}