diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2012-11-13 00:08:34 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2012-11-13 00:08:34 +0000 |
commit | d05df512cd6dfa32a696bcdd3dced825efe94bc4 (patch) | |
tree | e8adef3c49a5f079a29913f4649c02632bf0cfd4 /test/SemaTemplate/dependent-names.cpp | |
parent | 51ceb7bab599ea7d39d290ff5e88e4a1f0f5bc5c (diff) |
When filtering the list of associated namespaces so that we don't suggest people
add functions to namespace 'std', also filter out namespaces with '__' anywhere
in the name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167786 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/dependent-names.cpp')
-rw-r--r-- | test/SemaTemplate/dependent-names.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaTemplate/dependent-names.cpp b/test/SemaTemplate/dependent-names.cpp index efa4d28723..7ef12b8788 100644 --- a/test/SemaTemplate/dependent-names.cpp +++ b/test/SemaTemplate/dependent-names.cpp @@ -346,3 +346,17 @@ namespace rdar12629723 { virtual void foo() { } }; } + +namespace test_reserved_identifiers { + template<typename A, typename B> void tempf(A a, B b) { + a + b; // expected-error{{call to function 'operator+' that is neither visible in the template definition nor found by argument-dependent lookup}} + } + namespace __gnu_cxx { struct X {}; } + namespace ns { struct Y {}; } + void operator+(__gnu_cxx::X, ns::Y); // expected-note{{or in namespace 'test_reserved_identifiers::ns'}} + void test() { + __gnu_cxx::X x; + ns::Y y; + tempf(x, y); // expected-note{{in instantiation of}} + } +} |