summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/linkage2.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-04-25 20:12:36 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-04-25 20:12:36 +0000
commit3626b7e451016c72668e278cc4f751b0b91975e2 (patch)
treeebcc1bf602055ac48584b3a687afa6b655c38af9 /clang/test/SemaCXX/linkage2.cpp
parentf43cbeee1577e2c681ba0106f05d8ac7c97943ac (diff)
downloadbcm5719-llvm-3626b7e451016c72668e278cc4f751b0b91975e2.tar.gz
bcm5719-llvm-3626b7e451016c72668e278cc4f751b0b91975e2.zip
Put friend decls in the correct context.
When we find a friend declaration we have to skip transparent contexts for doing lookups, but we should not skip them when inserting the new decl if the lookup found nothing. Fixes PR15841. llvm-svn: 180571
Diffstat (limited to 'clang/test/SemaCXX/linkage2.cpp')
-rw-r--r--clang/test/SemaCXX/linkage2.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/linkage2.cpp b/clang/test/SemaCXX/linkage2.cpp
index ddf4064215d..3cfa98138ba 100644
--- a/clang/test/SemaCXX/linkage2.cpp
+++ b/clang/test/SemaCXX/linkage2.cpp
@@ -152,3 +152,15 @@ namespace test15 {
const int a = 5; // expected-note {{previous definition is here}}
static const int a; // expected-error {{redefinition of 'a'}}
}
+
+namespace test16 {
+ extern "C" {
+ class Foo {
+ int x;
+ friend int bar(Foo *y);
+ };
+ int bar(Foo *y) {
+ return y->x;
+ }
+ }
+}
OpenPOWER on IntegriCloud