summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/Sema.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-24 20:03:32 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-24 20:03:32 +0000
commiteddf4333fd5aa64a9f80371e89bf05d4aab18aab (patch)
treee403651cd5718322372db5cdb3a66d4d8366bbc4 /clang/lib/Sema/Sema.h
parent5d68a20949723c4725b64d63472b3da2f44f5fe4 (diff)
downloadbcm5719-llvm-eddf4333fd5aa64a9f80371e89bf05d4aab18aab.tar.gz
bcm5719-llvm-eddf4333fd5aa64a9f80371e89bf05d4aab18aab.zip
When we're declaring an object or function with linkage, teach name
lookup to skip over names without linkage. This finishes <rdar://problem/6127293>. llvm-svn: 65386
Diffstat (limited to 'clang/lib/Sema/Sema.h')
-rw-r--r--clang/lib/Sema/Sema.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h
index e67c8782534..26d0f1dda8d 100644
--- a/clang/lib/Sema/Sema.h
+++ b/clang/lib/Sema/Sema.h
@@ -567,7 +567,12 @@ public:
/// Look up a namespace name within a C++ using directive or
/// namespace alias definition, ignoring non-namespace names (C++
/// [basic.lookup.udir]p1).
- LookupNamespaceName
+ LookupNamespaceName,
+ // Look up an ordinary name that is going to be redeclared as a
+ // name with linkage. This lookup ignores any declarations that
+ // are outside of the current scope unless they have linkage. See
+ // C99 6.2.2p4-5 and C++ [basic.link]p6.
+ LookupRedeclarationWithLinkage
};
/// @brief Represents the results of name lookup.
@@ -807,12 +812,13 @@ private:
public:
/// Determines whether D is a suitable lookup result according to the
/// lookup criteria.
- static bool isAcceptableLookupResult(Decl *D, LookupNameKind NameKind,
+ static bool isAcceptableLookupResult(NamedDecl *D, LookupNameKind NameKind,
unsigned IDNS) {
switch (NameKind) {
case Sema::LookupOrdinaryName:
case Sema::LookupTagName:
case Sema::LookupMemberName:
+ case Sema::LookupRedeclarationWithLinkage: // FIXME: check linkage, scoping
return D->isInIdentifierNamespace(IDNS);
case Sema::LookupOperatorName:
OpenPOWER on IntegriCloud