diff options
author | Matt Beaumont-Gay <matthewbg@google.com> | 2012-10-23 06:15:26 +0000 |
---|---|---|
committer | Matt Beaumont-Gay <matthewbg@google.com> | 2012-10-23 06:15:26 +0000 |
commit | abf836cffa8ea53e67f56fddc49ed7063f7a0e85 (patch) | |
tree | dee7a1123813034b2da169f988d2942259a2591c /clang/test/SemaCXX/unused.cpp | |
parent | 58df27cb2e4d7768356c94f13d6d7dc16e43a6ab (diff) | |
download | bcm5719-llvm-abf836cffa8ea53e67f56fddc49ed7063f7a0e85.tar.gz bcm5719-llvm-abf836cffa8ea53e67f56fddc49ed7063f7a0e85.zip |
Fix -Wunused-value to not warn on expressions that have unresolved lookups due
to dependent arguments.
llvm-svn: 166468
Diffstat (limited to 'clang/test/SemaCXX/unused.cpp')
-rw-r--r-- | clang/test/SemaCXX/unused.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/unused.cpp b/clang/test/SemaCXX/unused.cpp index b9877a1ba4f..fbaf8c8bf3c 100644 --- a/clang/test/SemaCXX/unused.cpp +++ b/clang/test/SemaCXX/unused.cpp @@ -46,3 +46,18 @@ namespace AnonObject { 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 + } + }; +} |