Commit Graph

15 Commits

Author SHA1 Message Date
Daniel Dunbar 8fbe78f6fc Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

llvm-svn: 91446
2009-12-15 20:14:24 +00:00
Douglas Gregor 6af6c3ee56 Turn off -Wsign-compare warnings by default
llvm-svn: 86233
2009-11-06 05:24:12 +00:00
John McCall 1fa36b7cab Implement the conditional-operator part of -Wsign-compare. Turn
DiagnoseSignCompare into Sema::CheckSignCompare and call it from more places.

Add some enumerator tests.  These seem to expose some oddities in the
types we're converting C++ enumerators to;  in particular, they're converting
to unsigned before int, which seems to contradict 4.5 [conv.prom] p2.

Note to self: stop baiting Doug in my commit messages.

llvm-svn: 86128
2009-11-05 09:23:39 +00:00
Steve Naroff ea4c780da1 Sema::CheckConditionalOperands(): Soften pointer/integer mismatch from error->warning.
Fixes <rdar://problem/6762239> [sema] gcc incompatibility; error on incompatible operand types in ?:.

llvm-svn: 68617
2009-04-08 17:05:15 +00:00
Daniel Dunbar a45cf5b6b0 Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.

llvm-svn: 67602
2009-03-24 02:24:46 +00:00
Steve Naroff bf1516c618 Fix <rdar://problem/5928590> clang -fsyntax-only: "incompatible operand types ('int' and 'void')" on input that 'gcc -fsyntax-only' eats
llvm-svn: 51002
2008-05-12 21:44:38 +00:00
Eli Friedman 2be9af9556 Fix a minor bug in isNullPointerConstant triggered by the linux
tgmath.h.

Note that there is another issue with tgmath.h, so mandel.c still 
doesn't work.

llvm-svn: 47069
2008-02-13 17:29:58 +00:00
Eli Friedman a7bf7ed476 Make typechecking for enum+int compatibility stricter.
llvm-svn: 47005
2008-02-12 08:46:17 +00:00
Eli Friedman 16f909670e Fix type compatibility between constant and variable arrays.
llvm-svn: 47003
2008-02-12 08:23:06 +00:00
Eli Friedman fadc8462be Add a couple of sema tests for qualifiers with conditionals containing
void*.

llvm-svn: 46939
2008-02-10 23:14:16 +00:00
Steve Naroff 2a2c5b98ee Fix test case and add a FIXME.
llvm-svn: 46577
2008-01-30 21:50:43 +00:00
Steve Naroff 4871fe0b8f Revert r45951, Chris says it violates the C99 spec.
llvm-svn: 45961
2008-01-14 16:10:57 +00:00
Steve Naroff 090353191c Rewrite Expr::isNullPointerConstant() to deal with multiple levels of explicit casts.
Now, isNullPointerConstant() will return true for the following: "(void*)(double*)0"

llvm-svn: 45951
2008-01-14 02:53:34 +00:00
Steve Naroff 826e91ae04 Change Sema::CheckAddressOfOperation() to respect C99-only addressof rules.
Remove diagnostics from Sema::CheckIndirectionOperand(). C89/C99 allow dereferencing an incomplete type. clang appears to be emulating some incorrect gcc behavior (see below).

void
foo (void)
{
 struct b;
 struct b* x = 0;
 struct b* y = &*x; // gcc produces an error ("dereferencing pointer to incomplete type")
}

With this patch, the above is now allowed.

Bug/Patch by Eli Friedman!

llvm-svn: 45933
2008-01-13 17:10:08 +00:00
Steve Naroff 039ad3cf90 Fix Sema::CheckConditionalOperands(). The null pointer constant checks need to precede the check for two pointer operands.
llvm-svn: 45732
2008-01-08 01:11:38 +00:00