From: Chandler Carruth Date: Mon, 2 May 2011 18:54:36 +0000 (+0000) Subject: Don't abuse reinterpret cast to do something the API of PointerUnion X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7193b3ee1abf4997c3c46486c43e70f3221d3ef3;p=clang 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 --- 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()) - return &reinterpret_cast(DeclOrVector) + 1; + if (DeclOrVector.is()) + return DeclOrVector.getAddrOf() + 1; return DeclOrVector.get()->end(); }