repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git]
/
clang
/
test
/
SemaCXX
/
virtual-function-in-union.cpp
blob
b7cf26618c9fb41e0b31c284b72f539f22efad0f
1
// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3
union
U
{
4
int
d
;
5
virtual
int
f
() {
return
d
; };
// expected-error {{unions cannot have virtual functions}}
6
};
7
8
int
foo
() {
U u
;
return
u
.
d
; }