diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-02-24 00:03:53 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-02-24 00:03:53 +0000 |
commit | 6c3c3f53b32288f0be38e010c96da271f264f2ad (patch) | |
tree | b698160963e5f32f69f1ad061667beeaeb8fcbd0 /test/SemaCXX/shift.cpp | |
parent | 06efbd9a87fe3f01ec9652083c1f7815ada9b605 (diff) |
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
Diffstat (limited to 'test/SemaCXX/shift.cpp')
-rw-r--r-- | test/SemaCXX/shift.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaCXX/shift.cpp b/test/SemaCXX/shift.cpp new file mode 100644 index 0000000000..c5e50128c9 --- /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}} +} |