diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-12 16:00:01 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-12 16:00:01 +0000 |
commit | ce40e2ef8a53a0e1163d49b9b322b4d0baf8f395 (patch) | |
tree | 5394aff3f6039ce9358543a9e86b1048643baaba /clang/test/SemaTemplate/friend.cpp | |
parent | 4885db6f52cae121f476f0725507ea287f8b7684 (diff) | |
download | bcm5719-llvm-ce40e2ef8a53a0e1163d49b9b322b4d0baf8f395.tar.gz bcm5719-llvm-ce40e2ef8a53a0e1163d49b9b322b4d0baf8f395.zip |
Fix a crash-on-invalid involving name lookup of tag names, where we
ended up finding a function template that we didn't expect. Recover
more gracefully, and fix a similar issue for class templates.
llvm-svn: 101040
Diffstat (limited to 'clang/test/SemaTemplate/friend.cpp')
-rw-r--r-- | clang/test/SemaTemplate/friend.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/friend.cpp b/clang/test/SemaTemplate/friend.cpp index 61ef1865da5..99685f2396c 100644 --- a/clang/test/SemaTemplate/friend.cpp +++ b/clang/test/SemaTemplate/friend.cpp @@ -12,3 +12,22 @@ void f() { struct C0 { friend struct A<int>; }; + +namespace PR6770 { + namespace N { + int f1(int); + } + using namespace N; + + namespace M { + float f1(float); + } + using M::f1; + + template<typename T> void f1(T, T); + template <class T> + void f() { + friend class f; // expected-error{{'friend' used outside of class}} + friend class f1; // expected-error{{ 'friend' used outside of class}} + } +} |