summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2012-03-14 20:41:00 +0000
committerNick Lewycky <nicholas@mxc.ca>2012-03-14 20:41:00 +0000
commit5a7120cf82b5f0110cb70aacad850c594a55b378 (patch)
tree038ec61c24a410cc408d8c4c0dd9a710638d2875 /test/SemaCXX
parentd53e877ddf885da28aa4668148a5f0ce0045ab54 (diff)
When emitting a diagnostic about two-phase name lookup, don't do useless
qualified name lookups into transparent contexts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152739 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX')
-rw-r--r--test/SemaCXX/warn-unused-value.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-unused-value.cpp b/test/SemaCXX/warn-unused-value.cpp
index 80298ec666..1c0263c581 100644
--- a/test/SemaCXX/warn-unused-value.cpp
+++ b/test/SemaCXX/warn-unused-value.cpp
@@ -30,3 +30,22 @@ void b(Foo f1, Foo f2) {
}
#undef NOP
}
+
+namespace test2 {
+ extern "C" {
+ namespace std {
+ template<typename T> struct basic_string {
+ struct X {};
+ void method() const {
+ X* x;
+ &x[0]; // expected-warning {{expression result unused}}
+ }
+ };
+ typedef basic_string<char> string;
+ void func(const std::string& str) {
+ str.method(); // expected-note {{in instantiation of member function}}
+ }
+ }
+ }
+}
+