Handle value dependent LHS as well as RHS. Test both of these, they
don't seem to have been covered by our tests previously.

This should fix bootstrap failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126345 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/shift.cpp b/test/SemaCXX/shift.cpp
new file mode 100644
index 0000000..c5e5012
--- /dev/null
+++ b/test/SemaCXX/shift.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -Wall -Wshift-sign-overflow -ffreestanding -fsyntax-only -verify %s
+
+#include <limits.h>
+
+#define WORD_BIT (sizeof(int) * CHAR_BIT)
+
+template <int N> void f() {
+  (void)(N << 30); // expected-warning {{the promoted type of the shift expression is 'int'}}
+  (void)(30 << N); // expected-warning {{the promoted type of the shift expression is 'int'}}
+}
+
+void test() {
+  f<30>(); // expected-note {{instantiation}}
+}