diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2013-02-02 00:25:55 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2013-02-02 00:25:55 +0000 |
commit | 45b50528340fae3d1482cf19297b8e16ab38bdba (patch) | |
tree | 9f740f5af3e72abae4b3fadbc40fa24f93a99839 /clang/test/SemaCXX/undefined-internal.cpp | |
parent | 535d97cc86326ccc24cbb0c03eb059d07d172912 (diff) | |
download | bcm5719-llvm-45b50528340fae3d1482cf19297b8e16ab38bdba.tar.gz bcm5719-llvm-45b50528340fae3d1482cf19297b8e16ab38bdba.zip |
This patch makes "&Cls::purevfn" not an odr use. This isn't what the standard
says, but that's a defect (to be filed). "Cls::purevfn()" is still an odr use.
Also fixes a bug that caused us to not mark the function referenced just
because we didn't want to mark it odr used.
llvm-svn: 174242
Diffstat (limited to 'clang/test/SemaCXX/undefined-internal.cpp')
-rw-r--r-- | clang/test/SemaCXX/undefined-internal.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/undefined-internal.cpp b/clang/test/SemaCXX/undefined-internal.cpp index 62c6ff96ca9..227e6b4a85e 100644 --- a/clang/test/SemaCXX/undefined-internal.cpp +++ b/clang/test/SemaCXX/undefined-internal.cpp @@ -212,3 +212,22 @@ namespace test9 { x.X::used(); // expected-note {{used here}} } } + +namespace test10 { + namespace { + struct X { + virtual void notused() = 0; + virtual void used() = 0; // expected-warning {{function 'test10::<anonymous namespace>::X::used' has internal linkage but is not defined}} + + void test() { + notused(); + (void)&X::notused; + (this->*&X::notused)(); + X::used(); // expected-note {{used here}} + } + }; + struct Y : X { + using X::notused; + }; + } +} |