diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
commit | 13cc256e404620c1de0cbcc4e43ce1e2dbbc4898 (patch) | |
tree | 2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /test/SemaCXX/unused.cpp | |
parent | 657bc3d9848e3be92029b2416031340988cd0111 (diff) | |
download | src-test2-13cc256e404620c1de0cbcc4e43ce1e2dbbc4898.tar.gz src-test2-13cc256e404620c1de0cbcc4e43ce1e2dbbc4898.zip |
Notes
Diffstat (limited to 'test/SemaCXX/unused.cpp')
-rw-r--r-- | test/SemaCXX/unused.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/SemaCXX/unused.cpp b/test/SemaCXX/unused.cpp index 54898c828ec6..fbaf8c8bf3c1 100644 --- a/test/SemaCXX/unused.cpp +++ b/test/SemaCXX/unused.cpp @@ -34,3 +34,30 @@ namespace derefvolatile { (void)y; // don't warn here, because it's a common pattern. } } + +// <rdar://problem/12359208> +namespace AnonObject { + struct Foo { + Foo(const char* const message); + ~Foo(); + }; + void f() { + Foo("Hello World!"); // don't warn + int(1); // expected-warning {{expression result unused}} + } +} + +// Test that constructing an object (which may have side effects) with +// constructor arguments which are dependent doesn't produce an unused value +// warning. +namespace UnresolvedLookup { + struct Foo { + Foo(int i, int j); + }; + template <typename T> + struct Bar { + void f(T t) { + Foo(t, 0); // no warning + } + }; +} |