summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/init.c
Commit message (Collapse)AuthorAgeFilesLines
* Make Expr::isConstantInitializer match IRGen.Eli Friedman2013-07-161-0/+3
| | | | | | | | | | Sema needs to be able to accurately determine what will be emitted as a constant initializer and what will not, so we get accurate errors in C and accurate -Wglobal-constructors warnings in C++. This makes Expr::isConstantInitializer match CGExprConstant as closely as possible. llvm-svn: 186464
* Move the test for PR13720 from Sema/init.c to Sema/thread-specifier.c.Hans Wennborg2012-08-291-7/+0
| | | | | | Can't use __thread in init.c because it doesn't have a triple. llvm-svn: 162836
* The address of a TLS var is not compile-time constant (PR13720)Hans Wennborg2012-08-291-0/+7
| | | | | | | | | | | | This makes Clang produce an error for code such as: __thread int x; int *p = &x; The lvalue of a thread-local variable cannot be evaluated at compile time. llvm-svn: 162835
* Switching to using dyn_cast_or_null, and fixing line endings in the test case.Aaron Ballman2012-02-091-6/+6
| | | | llvm-svn: 150209
* Attempting to initialize a union member that does not exist no longer crashes.Aaron Ballman2012-02-091-3/+12
| | | | | | Patch by Remi Gacogne llvm-svn: 150144
* CheckStringInit has side effects; make sure we don't run it in VerifyOnly ↵Eli Friedman2011-09-261-0/+4
| | | | | | | | mode, at least for the moment. <rdar://problem/10185490>. Sebastian, please take a look at this; I'm not entirely sure it is the right thing to do. llvm-svn: 140552
* fix PR8217, a silent miscompilation of invalid code.Chris Lattner2010-10-101-0/+1
| | | | llvm-svn: 116166
* tests: Use -ffreestanding when including stdint.h, to avoid platform ↵Daniel Dunbar2010-09-071-1/+1
| | | | | | dependencies. llvm-svn: 113301
* Vector types are not arithmetic types, either. Note that we now banDouglas Gregor2010-06-221-2/+0
| | | | | | | | | __real myvec and __imag myvec, since they aren't all that useful (it's just an identity function) but we might want to use them in more restricted cases in the future (e.g., "__real mycomplexvec" could extract the real parts of a vector of complex numbers). llvm-svn: 106601
* Fix PR4386 by implementing gcc's old behaviour (4.2) when initializingRafael Espindola2010-05-071-0/+14
| | | | | | variables with a comparison of a function pointer with 0. llvm-svn: 103253
* Fix PR6327: restore invariants when there's a parse error in an initializer.John McCall2010-03-311-1/+2
| | | | llvm-svn: 99980
* Initialization improvements: addition of string initialization and a fewEli Friedman2009-12-191-1/+1
| | | | | | | | small bug fixes in SemaInit, switch over SemaDecl to use it more often, and change a bunch of diagnostics which are different with the new initialization code. llvm-svn: 91767
* 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
* Fix for PR5447: teach Evaluate to deal with floating-point conditionals.Eli Friedman2009-12-041-0/+4
| | | | llvm-svn: 90521
* Reorganize the parsing of decl groups / function definitions so thatJohn McCall2009-11-031-1/+1
| | | | | | | declarators are parsed primarily within a single function (at least for these cases). Remove some excess diagnostics arising during parse failures. llvm-svn: 85924
* Fix for PR4285: allow intializing a const wchar_t array with a wide Eli Friedman2009-05-311-0/+4
| | | | | | string. llvm-svn: 72663
* Explictly track tentative definitions within Sema, then hand thoseDouglas Gregor2009-04-211-2/+1
| | | | | | | | | | | | | | | tentative definitions off to the ASTConsumer at the end of the translation unit. Eliminate CodeGen's internal tracking of tentative definitions, and instead hook into ASTConsumer::CompleteTentativeDefinition. Also, tweak the definition-deferal logic for C++, where there are no tentative definitions. Fixes <rdar://problem/6808352>, and will make it much easier for precompiled headers to cope with tentative definitions in the future. llvm-svn: 69681
* hoist checks for ; and in out of ParseInitDeclaratorListAfterFirstDeclaratorChris Lattner2009-03-291-1/+1
| | | | | | into ParseSimpleDeclaration, and improve a diagnostic. llvm-svn: 68009
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Fix PR3868 by making Evaluate handle cases like "(long)&a + 4".Eli Friedman2009-03-241-0/+3
| | | | llvm-svn: 67593
* Add type checking for tentative definitions at the end of theDouglas Gregor2009-03-101-1/+2
| | | | | | | | | translation unit. Thread the various declarations of variables via VarDecl::getPreviousDeclaration. llvm-svn: 66601
* A few small improvements to Evaluate for stuff I noted in FIXMEs.Eli Friedman2009-02-231-0/+9
| | | | llvm-svn: 65305
* Fix test to be legal on 64-bit systems.Eli Friedman2009-02-221-1/+1
| | | | llvm-svn: 65270
* Downgrade the "excess elements in initializer" errors to warnings *inDouglas Gregor2009-02-181-0/+2
| | | | | | C*. They're required errors in C++. llvm-svn: 64964
* Use our new snazzy stdint.h to make a testcase 64-bit portable.Sebastian Redl2009-02-071-1/+3
| | | | llvm-svn: 63985
* Add iterators to LookupResult, allowing one to iterate over theDouglas Gregor2009-02-021-0/+10
| | | | | | | non-ambiguous name lookup results without allocating any memory, e.g., for sets of overloaded functions. llvm-svn: 63549
* Closed out a few radars that were addressed by designated initializersDouglas Gregor2009-01-301-0/+16
| | | | llvm-svn: 63398
* Ignore parens when determining if an expr is a string literal. Fixes PR3382.Anders Carlsson2009-01-241-0/+2
| | | | llvm-svn: 62922
* Properly manage the bit-widths of APInts/APSInts in array initialization.Douglas Gregor2009-01-231-1/+3
| | | | | | Fixes PR clang/3377 llvm-svn: 62851
* Centralize error reporting of improper uses of incomplete types in theDouglas Gregor2009-01-191-1/+2
| | | | | | | | | | new DiagnoseIncompleteType. It provides additional information about struct/class/union/enum types when possible, either by pointing to the forward declaration of that type or by pointing to the definition (if we're in the process of defining that type). Fixes <rdar://problem/6500531>. llvm-svn: 62521
* Fix test cases broken by quote normalization in diagnostics.Sebastian Redl2008-11-221-1/+1
| | | | llvm-svn: 59888
* Fix PR3031 by silencing follow-on errors in invalid declarations.Chris Lattner2008-11-111-1/+1
| | | | llvm-svn: 59027
* Fix crash caused by this:Argyrios Kyrtzidis2008-11-071-0/+1
| | | | | | | | void f() { int +; // crash here } llvm-svn: 58846
* Fix PR3001: if we have an error parsing an initializer, make sure to removeChris Lattner2008-11-031-0/+7
| | | | | | | the designator corresponding to it, otherwise Sema and later parsing will get confused. llvm-svn: 58603
* add the other test case for completeness and to avoid regressions in the futureNuno Lopes2008-09-021-1/+2
| | | | llvm-svn: 55629
* Fix for PR2747: allow pointer->int casts with a null base; these are Eli Friedman2008-09-021-0/+8
| | | | | | offset-of-like expressions. llvm-svn: 55627
* Add test case for function-pointer-cast-of-global as constantDaniel Dunbar2008-08-251-0/+4
| | | | | | expression. llvm-svn: 55323
* add testcase we already handle.Chris Lattner2008-08-191-0/+4
| | | | llvm-svn: 54967
* wrap some long diagnostics, make 'initializer is not a constant' diagnosticChris Lattner2008-08-101-1/+1
| | | | | | a bit more clear (rdar://5646070) llvm-svn: 54606
* Make sure to allow assigning a pointer to a bool.Eli Friedman2008-05-301-0/+8
| | | | llvm-svn: 51778
* Fix a couple of bugs found by Neil Booth in the const-ness checking.Eli Friedman2008-05-211-0/+12
| | | | llvm-svn: 51361
* add testcase for pr2050 which is now fixed.Chris Lattner2008-05-041-0/+13
| | | | llvm-svn: 50610
* Improve diagnostic for illegal array initialization.Eli Friedman2008-02-081-0/+4
| | | | llvm-svn: 46869
* all filevar's have static storage. Previously a global withChris Lattner2007-12-021-0/+5
| | | | | | | extern storage class was returning false from hasStaticStorage. Ted, please review this. llvm-svn: 44515
* add several cases that Expr::hasStaticStorage missed, pointed out by Oliver HuntChris Lattner2007-11-271-0/+4
| | | | llvm-svn: 44376
* Implement test/Sema/init.c by treating functions as constants.Chris Lattner2007-11-011-0/+6
llvm-svn: 43599
OpenPOWER on IntegriCloud