summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/static-init.c
Commit message (Collapse)AuthorAgeFilesLines
* PR16074, implement warnings to catch pointer to boolean true and pointer toRichard Trieu2014-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | null comparison when the pointer is known to be non-null. This catches the array to pointer decay, function to pointer decay and address of variables. This does not catch address of function since this has been previously used to silence a warning. Pointer to bool conversion is under -Wbool-conversion. Pointer to null comparison is under -Wtautological-pointer-compare, a sub-group of -Wtautological-compare. void foo() { int arr[5]; int x; // warn on these conditionals if (foo); if (arr); if (&x); if (foo == null); if (arr == null); if (&x == null); if (&foo); // no warning } llvm-svn: 202216
* Attempt to fix test on 32-bit hosts.Eli Friedman2011-12-211-1/+1
| | | | llvm-svn: 147030
* Fix a case where Expr::isConstantInitializer would return true for an ↵Eli Friedman2011-12-211-1/+2
| | | | | | expression we can't support. In a slightly amusing twist, the case in question was already in the clang regression tests marked as a valid construct. <rdar://problem/10020074> llvm-svn: 147026
* Fix test to not force triple, and also to not need stdint.h.Daniel Dunbar2010-02-171-2/+2
| | | | llvm-svn: 96499
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - 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
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-2/+2
| | | | llvm-svn: 81346
* Remove the -arch option from clang-cc: for all practical purposes, it's Eli Friedman2009-05-191-1/+1
| | | | | | redundant with -triple. llvm-svn: 72108
* PR4013 and PR4105: pointer-like types can only be cast to/from integers Eli Friedman2009-05-011-1/+1
| | | | | | and other pointer-like types. llvm-svn: 70531
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Throw the switch to exclusively use Evaluate (along with the small Eli Friedman2009-02-221-3/+6
| | | | | | | | | | | | | | | | helper isConstantInitializer) to check whether an initializer is constant. This passes tests, but it's possible that it'll cause regressions with real-world code. Future work: 1. The diagnostics obtained this way are lower quality at the moment; some work both here and in Evaluate is needed for accurate diagnostics. 2. We probably need some extra code when we're in -pedantic mode so we can strictly enforce the rules in C99 6.6p7. 3. Dead code cleanup (this should wait until after 2, because we might want to re-use some of the code). llvm-svn: 65265
* Force arch for these test cases.Daniel Dunbar2009-02-211-1/+1
| | | | llvm-svn: 65252
* emit diagnostic when casting a ptr to a small int when doing static ↵Nuno Lopes2009-02-021-1/+2
| | | | | | initialization (addresses Eli's comments I believe) llvm-svn: 63562
* allow cast from array to int to be considered as constantNuno Lopes2009-02-021-1/+13
| | | | llvm-svn: 63519
* wrap some long diagnostics, make 'initializer is not a constant' diagnosticChris Lattner2008-08-101-2/+2
| | | | | | a bit more clear (rdar://5646070) llvm-svn: 54606
* Allow a pointer implicitly cast to a bool as a constant expression, as Eli Friedman2008-05-301-0/+4
| | | | | | | | | | required by the standard (the standard doesn't know anything about implicit casts). Disallow pointers cast to non-integral arithmetic types as constant expressions. This was previously allowed by accident. llvm-svn: 51779
* Generate code for static variables that don't have initializers. Also, ↵Anders Carlsson2007-10-171-0/+3
report an error if a static initializer is not constant. llvm-svn: 43058
OpenPOWER on IntegriCloud