forked from OSchip/llvm-project
DeadStoresChecker: Don't warn about dead stores into volatile variables
llvm-svn: 273689
This commit is contained in:
parent
9f7f3e1e64
commit
bf95fff9bd
|
@ -278,6 +278,8 @@ public:
|
|||
RHS = RHS->IgnoreParenCasts();
|
||||
|
||||
QualType T = VD->getType();
|
||||
if (T.isVolatileQualified())
|
||||
return;
|
||||
if (T->isPointerType() || T->isObjCObjectPointerType()) {
|
||||
if (RHS->isNullPointerConstant(Ctx, Expr::NPC_ValueDependentIsNull))
|
||||
return;
|
||||
|
|
|
@ -569,3 +569,7 @@ void testBOComma() {
|
|||
|
||||
}
|
||||
|
||||
void testVolatile() {
|
||||
volatile int v;
|
||||
v = 0; // no warning
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue