summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2014-05-14 18:31:48 +0000
committerJohn McCall <rjmccall@apple.com>2014-05-14 18:31:48 +0000
commita16fc8920648d93ea58c88ee24164119f93d11f6 (patch)
tree2ea43a1ab5ed3c3844090b9583f5fdfabdc4ed03 /clang/lib/Sema/SemaDecl.cpp
parentf662f0a65e6fc4c637b6ecef76d237fa481fa296 (diff)
downloadbcm5719-llvm-a16fc8920648d93ea58c88ee24164119f93d11f6.tar.gz
bcm5719-llvm-a16fc8920648d93ea58c88ee24164119f93d11f6.zip
When we generate a redeclaration for an
elaborated-type-specifier, place it in the correct context. llvm-svn: 208799
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index c43c881f1ef..2f434cedfe6 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -10981,7 +10981,15 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
}
// Okay, this is definition of a previously declared or referenced
- // tag PrevDecl. We're going to create a new Decl for it.
+ // tag. We're going to create a new Decl for it.
+ }
+
+ // Okay, we're going to make a redeclaration. If this is some kind
+ // of reference, make sure we build the redeclaration in the same DC
+ // as the original, and ignore the current access specifier.
+ if (TUK == TUK_Friend || TUK == TUK_Reference) {
+ SearchDC = PrevTagDecl->getDeclContext();
+ AS = AS_none;
}
}
// If we get here we have (another) forward declaration or we
OpenPOWER on IntegriCloud