]> granicus.if.org Git - clang/commitdiff
Cast CachedLinkage to linkage to avoid "comparison between signed and unsigned intege...
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 7 Dec 2010 15:51:48 +0000 (15:51 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 7 Dec 2010 15:51:48 +0000 (15:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121143 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Decl.cpp

index d4cffb9b68268996d07c023805f4b00fa9d959f2..1861c8c9b6061419315b9694c32287f1d54ce4d5 100644 (file)
@@ -535,10 +535,8 @@ static LinkageInfo getLVForClassMember(const NamedDecl *D, LVFlags F) {
 
 Linkage NamedDecl::getLinkage() const {
   if (HasCachedLinkage) {
-#ifndef NDEBUG
-    assert(CachedLinkage == getLVForDecl(this, 
-                                  LVFlags::CreateOnlyDeclLinkage()).linkage());
-#endif
+    assert(Linkage(CachedLinkage) ==
+             getLVForDecl(this, LVFlags::CreateOnlyDeclLinkage()).linkage());
     return Linkage(CachedLinkage);
   }
 
@@ -550,7 +548,7 @@ Linkage NamedDecl::getLinkage() const {
 
 LinkageInfo NamedDecl::getLinkageAndVisibility() const {
   LinkageInfo LI = getLVForDecl(this, LVFlags());
-  assert(!HasCachedLinkage || (CachedLinkage == LI.linkage()));
+  assert(!HasCachedLinkage || Linkage(CachedLinkage) == LI.linkage());
   HasCachedLinkage = 1;
   CachedLinkage = LI.linkage();
   return LI;