summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/array-init.c
Commit message (Collapse)AuthorAgeFilesLines
* 64-bit test fixes.Sebastian Redl2008-11-121-5/+5
| | | | llvm-svn: 59165
* readd test as it passes correctly. nice, but weirdNuno Lopes2008-09-011-0/+14
| | | | llvm-svn: 55615
* Backing out r55607 due to logic errors and test regression.Eli Friedman2008-09-011-14/+0
| | | | | | I'll try to come up with a correct fix for the testcase sometime soon. llvm-svn: 55614
* fix one more this-is-not-a-constant error. test includedNuno Lopes2008-09-011-0/+3
| | | | llvm-svn: 55609
* make CheckArithmeticConstantExpression() aware of &foo and pointersNuno Lopes2008-09-011-0/+13
| | | | llvm-svn: 55607
* Support initialization of incomplete array with zero size (asDaniel Dunbar2008-08-181-1/+1
| | | | | | extension). llvm-svn: 54946
* 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
* Count the number of initializable members correctly in structs/unions Eli Friedman2008-05-251-0/+6
| | | | | | with unnamed members. llvm-svn: 51557
* Diagnose implicit init list for empty aggregate, like struct {}. Fixes Eli Friedman2008-05-251-0/+4
| | | | | | PR2151 (by not creating the empty implicit init list). llvm-svn: 51556
* Move the error checking for variable-sized objects so we don't Eli Friedman2008-05-251-0/+4
| | | | | | double-report errors; fixes PR2362. llvm-svn: 51555
* Switch on SemaInit; this makes some code in SemaDecl dead, but I'll give Eli Friedman2008-05-191-2/+2
| | | | | | it a few days to make sure there aren't any significant regressions. llvm-svn: 51273
* Fix PR2017 and silence some bogus errors.Chris Lattner2008-04-021-3/+2
| | | | llvm-svn: 49068
* Fix PR1992 by computing the right type for string literals, whichChris Lattner2008-02-111-5/+5
| | | | | | | | is an array type not a pointer type. This requires updating some diags that change and updating the code generator to handle the proper form of strings. llvm-svn: 46941
* Fix a bug with struct initializers (in Sema::CheckInitializerListTypes()). Steve Naroff2008-01-281-0/+5
| | | | | | | Test case included from bz1948 (thanks Neil!). Also fixed an 80 column violation... llvm-svn: 46430
* Replace Sema::CheckVariableInitList, CheckConstantInitList, and ↵Steve Naroff2008-01-251-4/+41
| | | | | | | | | | CheckForCharArrayInitializer with CheckInitializerListTypes. The new routine now supports struct/union initializers. This is a modified version of a patch by Eli Friedman. This version passes all of the clang tests and supports vectors:-) Note that Eli and I are still unsatisfied the implementation of CheckInitializerListTypes(). We'd like to find a more elegant implementation. Nevertheless, this is a complex part of the standard (and may be hard to simplify). Since the complexity is localized to this routine, we can iterate without too much disruption:-) llvm-svn: 46339
* Sema::CheckInitializerTypes(). Start simpliying and cleaning up...Steve Naroff2008-01-211-0/+5
| | | | llvm-svn: 46234
* add comments for the various AssignConvertType's, and split int->pointer ↵Chris Lattner2008-01-041-3/+3
| | | | | | from pointer->int. llvm-svn: 45591
* Merge all the 'assignment' diagnostic code into one routine, decloning Chris Lattner2008-01-041-3/+3
| | | | | | | | | | | | | it from several places. This merges the diagnostics, making them more uniform and fewer in number. This also simplifies and cleans up the code. Some highlights: 1. This removes a bunch of very-similar diagnostics. 2. This renames AssignmentCheckResult -> AssignConvertType 3. This merges PointerFromInt + IntFromPointer which were always treated the same. 4. This updates a bunch of test cases that have minor changes to the produced diagnostics. llvm-svn: 45589
* Add support for initializing char arrays from string literals.Steve Naroff2007-12-101-0/+25
| | | | | | Adapted from a patch by Anders Carlsson. llvm-svn: 44816
* Fix the following bug...Steve Naroff2007-10-181-0/+5
| | | | | | | | | | | | | | | | | unsigned char asso_values[] = { 34 }; int legal2() { return asso_values[0]; } The code that creates the new constant array type was operating on the original type. As a result, the constant type being generated was "unsigned char [1][]" (which is wrong). The fix is to operate on the element type - in this case, the correct type is "unsigned char [1]" I added this case to array-init.c, which clearly didn't catch this bogosity... llvm-svn: 43112
* rename -parse-ast-print to -ast-printChris Lattner2007-10-111-1/+1
| | | | | | | rename -parse-ast-dump to -ast-dump remove -parse-ast, which is redundant with -fsyntax-only llvm-svn: 42852
* Removed option "-parse-ast-check" from clang driver. This is now implementedTed Kremenek2007-09-261-1/+1
| | | | | | | | | | | | using "-parse-ast -verify". Updated all test cases (using a sed script) that invoked -parse-ast-check to now use -parse-ast -verify. Fixed a bug where using "-verify" instead of "-parse-ast-check" would not correctly create the DiagClient needed to accumulate diagnostics. llvm-svn: 42365
* Remove a FIXME. Replace a couple asserts with an appropriate errorSteve Naroff2007-09-121-0/+4
| | | | | | diagnostic for illegal initializers. llvm-svn: 41889
* More fun with initializers! Steve Naroff2007-09-041-1/+83
| | | | | | | | | - Fixed many bugs, enhanced test case considerably, added a diagnostic, etc. - Refactored CheckInitList() into CheckVariableInitList()/CheckConstantInitList(). - Added CheckInitExpr(). - Support for multi-dimensional arrays looking good. llvm-svn: 41690
* Finish getting "array-init.c" to work properly.Steve Naroff2007-09-031-3/+11
| | | | | | | | Array scalar initialization is now is reasonable shape. Next step, structure and array of structure initializers. llvm-svn: 41681
* More progress on array initializers.Steve Naroff2007-09-021-1/+5
| | | | | | | | - Added Expr::isConstantExpr(). - Added type checking for InitListExpr elements. - Added diagnostic for trying to initialize a variable sized object. llvm-svn: 41674
* More semantic analysis of initializers.Steve Naroff2007-09-021-0/+9
| | | | | | Added 2 errors and one warning, updated test case. llvm-svn: 41672
* Start implementing semantic analysis for C initializers.Steve Naroff2007-09-021-0/+27
Step 1: Start instantiating InitListExpr's. Step 2: Call newly added function Sema::CheckInitializer() from Sema::ParseDeclarator(). Step 3: Give InitListExpr's a preliminary type. Step 4: Start emitting diagnostics for simple assignments. Note: As a result of step 1, the CodeGen/mandel.c test asserts "Unimplemented agg expr!", which is expected. As a result of step 4, the test below now fails. This isn't expected and needs to be investigated (it appears type checking for C++ references is flawed in some way). ******************** TEST 'Sema/cxx-references.cpp' FAILED! ******************** Command: clang -fsyntax-only Sema/cxx-references.cpp Output: Sema/cxx-references.cpp:8:12: warning: incompatible pointer types assigning 'int &*' to 'int *' int *p = &r; ^~ Sema/cxx-references.cpp:10:20: error: incompatible types assigning 'int (int)' to 'int (&)(int)' int (&rg)(int) = g; ^ Sema/cxx-references.cpp:13:18: error: incompatible types assigning 'int [3]' to 'int (&)[3]' int (&ra)[3] = a; ^ Sema/cxx-references.cpp:16:14: error: incompatible types assigning 'int *' to 'int *&' int *& P = Q; ^ 4 diagnostics generated. ******************** TEST 'Sema/cxx-references.cpp' FAILED! ******************** llvm-svn: 41671
OpenPOWER on IntegriCloud