summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/class/class.friend/p2.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-07 17:57:12 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-07 17:57:12 +0000
commit3b4abb67921126aefbf67d15bd6cdb7aa7cf47ff (patch)
treefb16eb70f22a9eed18042aa5b6c548a5510c5474 /clang/test/CXX/class/class.friend/p2.cpp
parentafb9bc10fabd606d6b34a652886ec7f9a76a6cd9 (diff)
downloadbcm5719-llvm-3b4abb67921126aefbf67d15bd6cdb7aa7cf47ff.tar.gz
bcm5719-llvm-3b4abb67921126aefbf67d15bd6cdb7aa7cf47ff.zip
Improve handling of friend types in several ways:
- When instantiating a friend type template, perform semantic analysis on the resulting type. - Downgrade the errors concerning friend type declarations that do not refer to classes to ExtWarns in C++98/03. C++0x allows practically any type to be befriended, and ignores the friend declaration if the type is not a class. llvm-svn: 100635
Diffstat (limited to 'clang/test/CXX/class/class.friend/p2.cpp')
-rw-r--r--clang/test/CXX/class/class.friend/p2.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/CXX/class/class.friend/p2.cpp b/clang/test/CXX/class/class.friend/p2.cpp
index 9fe2b17e504..eb5036f8128 100644
--- a/clang/test/CXX/class/class.friend/p2.cpp
+++ b/clang/test/CXX/class/class.friend/p2.cpp
@@ -4,7 +4,7 @@ struct B0;
class A {
friend class B {}; // expected-error {{cannot define a type in a friend declaration}}
- friend int; // expected-error {{friends can only be classes or functions}}
- friend B0; // expected-error {{must specify 'struct' to befriend}}
+ friend int; // expected-warning {{non-class type 'int' cannot be a friend}}
+ friend B0; // expected-warning {{must specify 'struct' to befriend}}
friend class C; // okay
};
OpenPOWER on IntegriCloud