aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-05-02 18:54:36 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-05-02 18:54:36 +0000
commit7193b3ee1abf4997c3c46486c43e70f3221d3ef3 (patch)
tree98b4492883ac9fb1e053f33ccaa5ec2747dc61ce /lib/Sema/SemaLookup.cpp
parent850dd809534d172b66328d9827ae27880885ac5b (diff)
Don't abuse reinterpret cast to do something the API of PointerUnion
provides proper support for. This was caught by -Wundefined-reinterpret-cast, and I think a reasonable case for it to warn on. Also use is<...> instead of dyn_cast<...> when the result isn't needed. This whole thing should probably switch to using UsuallyTinyPtrVector. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130707 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r--lib/Sema/SemaLookup.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index 309c7712d4..775b1d146e 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -2410,8 +2410,8 @@ VisibleDeclsRecord::ShadowMapEntry::end() {
if (DeclOrVector.isNull())
return 0;
- if (DeclOrVector.dyn_cast<NamedDecl *>())
- return &reinterpret_cast<NamedDecl*&>(DeclOrVector) + 1;
+ if (DeclOrVector.is<NamedDecl *>())
+ return DeclOrVector.getAddrOf<NamedDecl *>() + 1;
return DeclOrVector.get<DeclVector *>()->end();
}