2011-02-24 08:03:53 +08:00
|
|
|
// 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() {
|
2011-02-25 01:13:15 +08:00
|
|
|
(void)(N << 30); // expected-warning {{bits to represent, but 'int' only has}}
|
|
|
|
(void)(30 << N); // expected-warning {{bits to represent, but 'int' only has}}
|
2011-02-24 08:03:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void test() {
|
|
|
|
f<30>(); // expected-note {{instantiation}}
|
|
|
|
}
|