of the shift wasn't a constant integer expression, now it (hopefully)
does.
PR: 22059
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233320
91177308-0d34-0410-b5e6-
96231b3b80d8
llvm::APSInt Right;
// Check right/shifter operand
if (RHS.get()->isValueDependent() ||
- !RHS.get()->isIntegerConstantExpr(Right, S.Context))
+ !RHS.get()->EvaluateAsInt(Right, S.Context))
return;
if (Right.isNegative()) {
--- /dev/null
+// RUN: %clang_cc1 -fsyntax-only -Wshift-count-negative -fblocks -verify %s
+
+int f(int a) {
+ const int i = -1;
+ return a << i; // expected-warning{{shift count is negative}}
+}