summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/block-misc.c
Commit message (Collapse)AuthorAgeFilesLines
* Improve the error message for assigning to read-only variables.Richard Trieu2015-04-111-2/+2
| | | | | | | | | | Previously, many error messages would simply be "read-only variable is not assignable" This change provides more information about why the variable is not assignable, as well as note to where the const is located. Differential Revision: http://reviews.llvm.org/D4479 llvm-svn: 234677
* Reword switch/goto diagnostics "protected scope" diagnostics. Making up a termRichard Smith2014-09-061-1/+1
| | | | | | | | "protected scope" is very unhelpful here and actively confuses users. Instead, simply state the nature of the problem in the diagnostic: we cannot jump from here to there. The notes explain nicely why not. llvm-svn: 217293
* Correct hyphenations in comments and assert messagesAlp Toker2013-12-051-1/+1
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. llvm-svn: 196466
* Modify how the -verify flag works. Currently, the verification string andRichard Trieu2011-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic message are compared. If either is a substring of the other, then no error is given. This gives rise to an unexpected case: // expect-error{{candidate function has different number of parameters}} will match the following error messages from Clang: candidate function has different number of parameters (expected 1 but has 2) candidate function has different number of parameters It will also match these other error messages: candidate function function has different number of parameters number of parameters This patch will change so that the verification string must be a substring of the diagnostic message before accepting. Also, all the failing tests from this change have been corrected. Some stats from this cleanup: 87 - removed extra spaces around verification strings 70 - wording updates to diagnostics 40 - extra leading or trailing characters (typos, unmatched parens or quotes) 35 - diagnostic level was included (error:, warning:, or note:) 18 - flag name put in the warning (-Wprotocol) llvm-svn: 146619
* Allow __func__ and __FUNCTION__ and __PRETTY_FUNCTION__ inside blocks.Fariborz Jahanian2010-07-231-0/+5
| | | | | | Radar 8218839. llvm-svn: 109272
* Change the 'declared at' diagnostic to say 'declared here'.Anders Carlsson2010-04-231-4/+4
| | | | llvm-svn: 102163
* Whenever we complain about a failed initialization of a function orDouglas Gregor2010-04-221-1/+1
| | | | | | | | | | | | | | | | | method parameter, provide a note pointing at the parameter itself so the user does not have to manually look for the function/method being called and match up parameters to arguments. For example, we now get: t.c:4:5: warning: incompatible pointer types passing 'long *' to parameter of type 'int *' [-pedantic] f(long_ptr); ^~~~~~~~ t.c:1:13: note: passing argument to parameter 'x' here void f(int *x); ^ llvm-svn: 102038
* Improve diagnostics when we fail to convert from a source type to aDouglas Gregor2010-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | destination type for initialization, assignment, parameter-passing, etc. The main issue fixed here is that we used rather confusing wording for diagnostics such as t.c:2:9: warning: initializing 'char const [2]' discards qualifiers, expected 'char *' [-pedantic] char *name = __func__; ^ ~~~~~~~~ We're not initializing a 'char const [2]', we're initializing a 'char *' with an expression of type 'char const [2]'. Similar problems existed for other diagnostics in this area, so I've normalized them all with more precise descriptive text to say what we're initializing/converting/assigning/etc. from and to. The warning for the code above is now: t.c:2:9: warning: initializing 'char *' from an expression of type 'char const [2]' discards qualifiers [-pedantic] char *name = __func__; ^ ~~~~~~~~ Fixes <rdar://problem/7447179>. llvm-svn: 100832
* Issue error when a byref array is accessed in a blockFariborz Jahanian2010-03-161-0/+2
| | | | | | literal. Fixes radar 7760213. llvm-svn: 98693
* Implement goto inside of blocks.Mike Stump2010-01-191-2/+1
| | | | llvm-svn: 93945
* add a bunch of missing prototypes to testsChris Lattner2010-01-091-0/+3
| | | | llvm-svn: 93072
* Add a radar reference.Mike Stump2010-01-051-0/+1
| | | | llvm-svn: 92678
* Disallow captured arrays in blocks as well. Radar 7438948.Mike Stump2010-01-051-0/+8
| | | | llvm-svn: 92677
* Disallow capturing vlas inside blocks.Mike Stump2010-01-051-1/+11
| | | | llvm-svn: 92676
* 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-12/+12
| | | | llvm-svn: 81346
* Prep for new warning.Mike Stump2009-07-221-1/+1
| | | | llvm-svn: 76709
* enhance the goto checker to reject jumps across __block variable definitions.Chris Lattner2009-07-191-0/+13
| | | | llvm-svn: 76376
* Don't allow defining a block with a non-prototype type. Remove a Eli Friedman2009-06-081-3/+3
| | | | | | | | | | hack which introduces some strange inconsistencies in compatibility for block pointers. Note that unlike an earlier revision proposed on cfe-commits, this patch still allows declaring block pointers without a prototype. llvm-svn: 73041
* Allow qualifiers on blocks. Radar 6441502Mike Stump2009-05-071-0/+5
| | | | llvm-svn: 71183
* Tighten up relationals with blocks and ints. Radar 6441502Mike Stump2009-05-071-0/+8
| | | | llvm-svn: 71171
* Improve semantic checking for blocks. Radar 6441502Mike Stump2009-05-071-0/+16
| | | | llvm-svn: 71145
* Add Sema checking for __block on vm declarations. Radar 6441502Mike Stump2009-05-011-1/+3
| | | | llvm-svn: 70601
* Sema checking for incorrect placement of __block. Radar 6441502Mike Stump2009-04-301-0/+8
| | | | llvm-svn: 70452
* Resolve merge conflict better.Mike Stump2009-04-211-9/+9
| | | | llvm-svn: 69748
* Tighten up blocks type checking. This was discussed back in theMike Stump2009-04-211-2/+10
| | | | | | r56595 timeframe, but left undone. Radar 6812711 llvm-svn: 69745
* Fix rdar://6814047, a crash on invalid in blocks code I noticed whenChris Lattner2009-04-211-6/+7
| | | | | | working on the previous fix. llvm-svn: 69742
* fix marking of nested blocks with the "hasBlockDeclRefExprs" toChris Lattner2009-04-211-0/+19
| | | | | | | | mark exactly the blocks which have references that are "live through". This fixes a rejects valid: rdar://6808730 - [sema] [blocks] block rejected at global scope llvm-svn: 69738
* merge two tests.Chris Lattner2009-04-181-0/+5
| | | | llvm-svn: 69466
* abstract the SwitchStack for blocks just like we do the goto labels.Chris Lattner2009-04-181-0/+17
| | | | | | This fixes a crash on invalid (test10). rdar://6805469 llvm-svn: 69465
* add some block goto test cases.Chris Lattner2009-04-181-3/+17
| | | | llvm-svn: 69460
* Fix block comparisons. Radar 6732116.Mike Stump2009-04-011-26/+31
| | | | llvm-svn: 68171
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Fixup expected errors.Mike Stump2009-02-081-1/+1
| | | | llvm-svn: 64074
* change getCurFunctionDecl to skip through Block contexts to findChris Lattner2008-12-041-0/+7
| | | | | | | | the containing block. Introduce a new getCurFunctionOrMethodDecl method to check to see if we're in a function or objc method. Minor cleanups to other related places. This fixes rdar://6405429. llvm-svn: 60564
* instead of forcing blocks on by default, make them default to off, but letChris Lattner2008-12-041-1/+1
| | | | | | | | specific targets default them to on. Default blocks to on on 10.6 and later. Add a -fblocks option that allows the user to override the target's default. Use -fblocks in the various testcases that use blocks. llvm-svn: 60563
* Implement rdar://6319320: give a good diagnostic for cases where peopleChris Lattner2008-11-171-1/+1
| | | | | | | are trying to use the old GCC "casts as lvalue" extension. We don't and will hopefully never support this. llvm-svn: 59460
* Fix rdar://6257721 by tightening up the block "snapshot" check, andChris Lattner2008-10-201-0/+8
| | | | | | move it to its own predicate to make it more clear. llvm-svn: 57796
* Fix rdar://6251437, references to enum constant decls in a blockChris Lattner2008-09-281-0/+14
| | | | | | don't need a BlockDeclRefExpr. llvm-svn: 56766
* More type checking for blocks. Still incomplete (will hopefully finish up ↵Steve Naroff2008-09-051-0/+50
this weekend). llvm-svn: 55862
OpenPOWER on IntegriCloud