From: Duncan Sands Date: Thu, 10 Jun 2010 15:06:05 +0000 (+0000) Subject: Avoid many "variable 'Sub' set but not used [-Wunused-but-set-variable]" warnings X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=39dea6ff768098f33da8441b8323100f68999573;p=oota-llvm.git Avoid many "variable 'Sub' set but not used [-Wunused-but-set-variable]" warnings with gcc-4.6. The warning is wrong, since Sub *is* used (perhaps gcc is confused because the use of Sub is constant folded away?), but since it is trivial to avoid, and massively reduces the amount of warning spew, just workaround the wrong warning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105788 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/SymbolTableListTraits.h b/include/llvm/SymbolTableListTraits.h index 39953e1a580..91a4eb99ff0 100644 --- a/include/llvm/SymbolTableListTraits.h +++ b/include/llvm/SymbolTableListTraits.h @@ -47,9 +47,8 @@ public: /// of instructions, it returns the BasicBlock that owns them. ItemParentClass *getListOwner() { typedef iplist ItemParentClass::*Sublist; - Sublist Sub(ItemParentClass:: - getSublistAccess(static_cast(0))); - size_t Offset(size_t(&((ItemParentClass*)0->*Sub))); + size_t Offset(size_t(&((ItemParentClass*)0->*ItemParentClass:: + getSublistAccess(static_cast(0))))); iplist* Anchor(static_cast*>(this)); return reinterpret_cast(reinterpret_cast(Anchor)- Offset);