diff options
| author | Anders Carlsson <andersca@mac.com> | 2009-01-16 16:48:51 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2009-01-16 16:48:51 +0000 |
| commit | a7d069d63c18a70ffb0a4b27687440356e73db23 (patch) | |
| tree | 9a1ed529b6997d3a91a5e2f8f349feb861443f7b /clang/test/SemaCXX/vararg-non-pod.cpp | |
| parent | 230c35eda2b2e4a0e80c70a0dbb1bbad54aae9fb (diff) | |
| download | bcm5719-llvm-a7d069d63c18a70ffb0a4b27687440356e73db23.tar.gz bcm5719-llvm-a7d069d63c18a70ffb0a4b27687440356e73db23.zip | |
Use a single function for doing vararg argument promotion. Also, make sure to do the promotion before checking the type - fixes PR3340.
llvm-svn: 62323
Diffstat (limited to 'clang/test/SemaCXX/vararg-non-pod.cpp')
| -rw-r--r-- | clang/test/SemaCXX/vararg-non-pod.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/vararg-non-pod.cpp b/clang/test/SemaCXX/vararg-non-pod.cpp index d413335243e..ac108e6ad55 100644 --- a/clang/test/SemaCXX/vararg-non-pod.cpp +++ b/clang/test/SemaCXX/vararg-non-pod.cpp @@ -1,5 +1,7 @@ // RUN: clang -fsyntax-only -verify -fblocks %s +extern char version[]; + class C { public: C(int); @@ -14,6 +16,7 @@ void t1() C c(10); g(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic function; call will abort at runtime}} + g(10, version); } void t2() @@ -21,8 +24,10 @@ void t2() C c(10); c.g(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic method; call will abort at runtime}} + c.g(10, version); C::h(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic function; call will abort at runtime}} + C::h(10, version); } int (^block)(int, ...); @@ -32,6 +37,7 @@ void t3() C c(10); block(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic block; call will abort at runtime}} + block(10, version); } class D { @@ -46,4 +52,5 @@ void t4() D d; d(10, c); // expected-warning{{Line 48: cannot pass object of non-POD type 'class C' through variadic method; call will abort at runtime}} + d(10, version); } |

