We were falling through from one case to another in a switch statement.
Oops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282124
91177308-0d34-0410-b5e6-
96231b3b80d8
goto tryAgain;
}
}
-
- return SLCT_NotALiteral;
}
+
+ return SLCT_NotALiteral;
}
case Stmt::UnaryOperatorClass: {
const UnaryOperator *UnaOp = cast<UnaryOperator>(E);
printf(s7 + 3, ""); // expected-warning{{more '%' conversions than data arguments}}
// expected-note@-2{{format string is defined here}}
}
+
+void PR30481() {
+ // This caused crashes due to invalid casts.
+ printf(1 > 0); // expected-warning{{format string is not a string literal}} expected-warning{{incompatible integer to pointer conversion}} expected-note@format-strings.c:*{{passing argument to parameter here}} expected-note{{to avoid this}}
+}