summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/class/class.friend
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-26 06:47:28 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-26 06:47:28 +0000
commit3dad842b356adf3435b3ec4af518b4bd4a7b5cd9 (patch)
tree18c8a7accd3d883a972b03ac50863e55439258c9 /clang/test/CXX/class/class.friend
parentccde96e96baff2447a260d5b00f4bb4c2385265b (diff)
downloadbcm5719-llvm-3dad842b356adf3435b3ec4af518b4bd4a7b5cd9.tar.gz
bcm5719-llvm-3dad842b356adf3435b3ec4af518b4bd4a7b5cd9.zip
Rework the Parse-Sema interaction for friends to better support friend
class templates. We now treat friend class templates much more like normal class templates, except that they still get special name lookup rules. Fixes PR5057 and eliminates a bunch of spurious diagnostics in <iostream>. llvm-svn: 82848
Diffstat (limited to 'clang/test/CXX/class/class.friend')
-rw-r--r--clang/test/CXX/class/class.friend/p2.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/test/CXX/class/class.friend/p2.cpp b/clang/test/CXX/class/class.friend/p2.cpp
index f130beb7d2c..98be2049e75 100644
--- a/clang/test/CXX/class/class.friend/p2.cpp
+++ b/clang/test/CXX/class/class.friend/p2.cpp
@@ -1,8 +1,10 @@
// RUN: clang-cc -fsyntax-only -verify %s
+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 B; // expected-error {{must specify 'class' in a friend class declaration}}
+ friend B0; // expected-error {{must specify 'struct' to befriend}}
friend class C; // okay
};
OpenPOWER on IntegriCloud