summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-08-09 04:35:01 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-08-09 04:35:01 +0000
commit114394f8246f7829b15e9e7b413ee9e13a60126c (patch)
treed7589ff1755ecdbca3aa95ac8a69c0726e85dac7 /clang/lib/AST/DeclBase.cpp
parent02d0bf0f80eb71f2b1e5b71ac2335f372a761d58 (diff)
downloadbcm5719-llvm-114394f8246f7829b15e9e7b413ee9e13a60126c.tar.gz
bcm5719-llvm-114394f8246f7829b15e9e7b413ee9e13a60126c.zip
Implement [class.friend]p11's special name lookup rules for friend declarations
of local classes. We were previously handling this by performing qualified lookup within a function declaration(!!); replace it with the proper scope lookup. llvm-svn: 188050
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r--clang/lib/AST/DeclBase.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index e99f7ec5b06..e46d671682f 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -1390,14 +1390,7 @@ void DeclContext::makeDeclVisibleInContextWithFlags(NamedDecl *D, bool Internal,
assert(this == getPrimaryContext() && "expected a primary DC");
// Skip declarations within functions.
- // FIXME: We shouldn't need to build lookup tables for function declarations
- // ever, and we can't do so correctly because we can't model the nesting of
- // scopes which occurs within functions. We use "qualified" lookup into
- // function declarations when handling friend declarations inside nested
- // classes, and consequently accept the following invalid code:
- //
- // void f() { void g(); { int g; struct S { friend void g(); }; } }
- if (isFunctionOrMethod() && !isa<FunctionDecl>(D))
+ if (isFunctionOrMethod())
return;
// Skip declarations which should be invisible to name lookup.
OpenPOWER on IntegriCloud