2008-02-03 04:20:10 +08:00
|
|
|
// RUN: clang %s -verify -pedantic -fsyntax-only
|
|
|
|
|
|
|
|
// PR1966
|
|
|
|
_Complex double test1() {
|
|
|
|
return __extension__ 1.0if;
|
|
|
|
}
|
|
|
|
|
|
|
|
_Complex double test2() {
|
|
|
|
return 1.0if; // expected-warning {{imaginary constants are an extension}}
|
|
|
|
}
|
|
|
|
|
2008-07-26 02:07:19 +08:00
|
|
|
// rdar://6097308
|
|
|
|
void test3() {
|
|
|
|
int x;
|
|
|
|
(__extension__ x) = 10;
|
|
|
|
}
|
|
|
|
|
2008-08-22 02:04:13 +08:00
|
|
|
// rdar://6162726
|
|
|
|
void test4() {
|
|
|
|
static int var;
|
|
|
|
var =+ 5; // expected-warning {{use of unary operator that may be intended as compound assignment (+=)}}
|
|
|
|
var =- 5; // expected-warning {{use of unary operator that may be intended as compound assignment (-=)}}
|
|
|
|
var = +5;
|
|
|
|
var = -5;
|
|
|
|
}
|
|
|
|
|