blob: d5a5bed9ea7a4ae8fd1976fc0d3a05e9221818c6 [file] [log] [blame]
Chandler Carruth6c3c3f52011-02-24 00:03:53 +00001// RUN: %clang_cc1 -Wall -Wshift-sign-overflow -ffreestanding -fsyntax-only -verify %s
2
3#include <limits.h>
4
5#define WORD_BIT (sizeof(int) * CHAR_BIT)
6
7template <int N> void f() {
Chandler Carruth5fa05cb2011-02-24 17:13:15 +00008 (void)(N << 30); // expected-warning {{bits to represent, but 'int' only has}}
9 (void)(30 << N); // expected-warning {{bits to represent, but 'int' only has}}
Chandler Carruth6c3c3f52011-02-24 00:03:53 +000010}
11
12void test() {
13 f<30>(); // expected-note {{instantiation}}
14}