summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser
Commit message (Collapse)AuthorAgeFilesLines
...
* Sema: Support for #pragma options align={reset,natural}. '#pragma options align'Daniel Dunbar2010-05-271-0/+12
| | | | | | shares the stack with '#pragma pack', who knew!? llvm-svn: 104786
* Improve parser recovery when a switch condition is invalid; fixesDouglas Gregor2010-05-201-0/+12
| | | | | | <rdar://problem/7971948>. llvm-svn: 104291
* Patch to fix a crash on incomplete class declaration.Fariborz Jahanian2010-05-141-0/+6
| | | | | | Radar 7923673. llvm-svn: 103812
* Improve error recovery in C/ObjC when the first argument of a functionChris Lattner2010-05-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | declarator is incorrect. Not being a typename causes the parser to dive down into the K&R identifier list handling stuff, which is almost never the right thing to do. Before: r.c:3:17: error: expected ')' void bar(intptr y); ^ r.c:3:9: note: to match this '(' void bar(intptr y); ^ r.c:3:10: error: a parameter list without types is only allowed in a function definition void bar(intptr y); ^ After: r.c:3:10: error: unknown type name 'intptr'; did you mean 'intptr_t'? void bar(intptr y); ^~~~~~ intptr_t r.c:1:13: note: 'intptr_t' declared here typedef int intptr_t; ^ This fixes rdar://7980651 - poor recovery for bad type in the first arg of a C function llvm-svn: 103783
* Namespaces can only be defined at global or namespace scope. Fixes PR6596.Douglas Gregor2010-05-141-0/+8
| | | | llvm-svn: 103767
* Fix a tentative-parse error with unqualified template ids in cast expressions.John McCall2010-04-301-3/+6
| | | | | | Also resolve a long-working FIXME in the test case I modified. llvm-svn: 102688
* Cleanup error recovery for a missing '-'|'+'Fariborz Jahanian2010-04-261-3/+1
| | | | | | on a method declaration (radar 7822196). llvm-svn: 102383
* Implement parsing for message sends in Objective-C++. Message sends inDouglas Gregor2010-04-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Objective-C++ have a more complex grammar than in Objective-C (surprise!), because (1) The receiver of an instance message can be a qualified name such as ::I or identity<I>::type. (2) Expressions in C++ can start with a type. The receiver grammar isn't actually ambiguous; it just takes a bit of work to parse past the type before deciding whether we have a type or expression. We do this in two places within the grammar: once for message sends and once when we're determining whether a []'d clause in an initializer list is a message send or a C99 designated initializer. This implementation of Objective-C++ message sends contains one known extension beyond GCC's implementation, which is to permit a typename-specifier as the receiver type for a class message, e.g., [typename compute_receiver_type<T>::type method]; Note that the same effect can be achieved in GCC by way of a typedef, e.g., typedef typename computed_receiver_type<T>::type Computed; [Computed method]; so this is merely a convenience. Note also that message sends still cannot involve dependent types or values. llvm-svn: 102031
* reapply john's patch, he broke mainline again by changing the test.Chris Lattner2010-04-202-0/+4
| | | | llvm-svn: 101871
* revert r101863, whcih is causing Sema/altivec-init.c to fail on a tonChris Lattner2010-04-202-4/+0
| | | | | | | | | | of buildbots with: error: 'error' diagnostics expected but not seen: Line 9: too few elements in vector initialization (expected 8 elements, have 2) 1 warning and 1 error generated. llvm-svn: 101864
* Altivec vector literal initializer count mismatch error removed.John Thompson2010-04-202-0/+4
| | | | llvm-svn: 101863
* improve altivec c++ support by adding casts, patch byChris Lattner2010-04-141-1/+0
| | | | | | Anton Yartsev! llvm-svn: 101281
* implement altivec.h and a bunch of support code, patch by Anton Yartsev!Chris Lattner2010-04-142-3/+3
| | | | llvm-svn: 101215
* fix PR6287 by accepting and ignoring the returns_twice attribute.Chris Lattner2010-04-121-0/+4
| | | | llvm-svn: 101005
* fix PR6811 by not parsing 'super' as a magic expression inChris Lattner2010-04-111-0/+18
| | | | | | | | | | | | | LookupInObjCMethod. Doing so allows all sorts of invalid code to slip through to codegen. This patch does not change the AST representation of super, though that would now be a natural thing to do since it can only be in the receiver position and in the base of a ObjCPropertyRefExpr. There are still several ugly areas handling super in the parser, but this is definitely a step in the right direction. llvm-svn: 100959
* Improve diagnostics when we fail to convert from a source type to aDouglas Gregor2010-04-095-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Downgrade the "declaration does not declare anything" error to aDouglas Gregor2010-04-082-2/+2
| | | | | | | warning. It's not harmful to have such pointless declarations, and GCC does not diagnose this issue consistently. llvm-svn: 100814
* Improve handling of friend types in several ways:Douglas Gregor2010-04-071-3/+3
| | | | | | | | | | | - When instantiating a friend type template, perform semantic analysis on the resulting type. - Downgrade the errors concerning friend type declarations that do not refer to classes to ExtWarns in C++98/03. C++0x allows practically any type to be befriended, and ignores the friend declaration if the type is not a class. llvm-svn: 100635
* Improve on diagnostics when an objc class is used asFariborz Jahanian2010-04-071-1/+1
| | | | | | a stand-alone type declaration. llvm-svn: 100588
* fix PR6782, an accept invalid. We weren't emitting the diagnostic Chris Lattner2010-04-051-0/+10
| | | | | | returned by SetTypeSpecType. llvm-svn: 100443
* Improve diagnosing when a method type does not start with '-'|'+'Fariborz Jahanian2010-04-021-0/+10
| | | | | | when parsing. Fixes radar 7822196. llvm-svn: 100248
* Issue better syntax error when objc's messagingFariborz Jahanian2010-03-311-0/+6
| | | | | | ares are not separated by ':' (radar 7030268). llvm-svn: 100040
* Don't skip past the '}' if an expression has error and is not followed by ';'.Argyrios Kyrtzidis2010-03-311-0/+5
| | | | llvm-svn: 99972
* When "delayed parsing" C++ default arguments, if there is an error, there ↵Argyrios Kyrtzidis2010-03-301-0/+9
| | | | | | | | | | | | may be tokens left in the token stream that will interfere (they will be parsed as if they are after the class' '}') and a crash will occur because the CachedTokens that holds them will be deleted while the lexer is still using them. Make sure that the tokens of default args are removed from the token stream. Fixes PR6647. llvm-svn: 99939
* Don't consume tokens past the end-of-file in an @interface. FixesDouglas Gregor2010-03-161-0/+7
| | | | | | <rdar://problem/7735566>. llvm-svn: 98613
* implement support for -Wno-deprecated, PR6534. WhileChris Lattner2010-03-072-38/+38
| | | | | | | I'm in there, change the altivec diagnostics to use 'double' instead of "double" for consistency. llvm-svn: 97919
* Don't infinite-loop if TryAnnotateCXXScopeToken fails to annotate but doesn'tJohn McCall2010-03-011-0/+4
| | | | | | | | | signal an error. This can happen even when the current token is '::' if this is a ::new or ::delete expression. This was an oversight in my recent parser refactor; fixes PR 5825. llvm-svn: 97462
* Fix an assertion-on-error during tentative constructor parsing byJohn McCall2010-02-261-1/+1
| | | | | | | | | | propagating error conditions out of the various annotate-me-a-snowflake routines. Generally (but not universally) removes redundant diagnostics as well as, you know, not crashing on bad code. On the other hand, I have just signed myself up to fix fiddly parser errors for the next week. Again. llvm-svn: 97221
* Retain attributes for K&R style parameter declarations.Richard Pennington2010-02-231-0/+11
| | | | llvm-svn: 96941
* dllimport and dllexport are declspec attributes, too. They're alsoCharles Davis2010-02-161-1/+1
| | | | | | | | Win32-specific. Also, fix a test to use FileCheck instead of grepping LLVM IR. llvm-svn: 96364
* Issue a bettter diagnostics for incorrect property setter name.Fariborz Jahanian2010-02-151-0/+2
| | | | | | (radar 7647953). llvm-svn: 96284
* Improve the diagnostic given when referring to a tag type without a tag (in C)John McCall2010-02-141-2/+2
| | | | | | | | | or that's been hidden by a non-type (in C++). The ideal C++ diagnostic here would note the hiding declaration, but this is a good start. llvm-svn: 96141
* Teach C++ name lookup that it's okay to look in a scope without aDouglas Gregor2010-02-051-0/+10
| | | | | | | | context. This happens fairly rarely (which is why we got away with this bug). Fixes PR6184, where we skipped over the template parameter scope while tentatively parsing. llvm-svn: 95376
* First stage of adding AltiVec supportJohn Thompson2010-02-052-0/+199
| | | | llvm-svn: 95335
* Declarators can have grouping parens. This fixes rdar://7608537.Chris Lattner2010-02-031-0/+3
| | | | llvm-svn: 95246
* fix PR6216Chris Lattner2010-02-031-0/+5
| | | | llvm-svn: 95185
* the declspec of a declaration can have storage-class specifiers,Chris Lattner2010-02-021-0/+4
| | | | | | | | | type qualifiers and type specifiers in any order. For example, this is valid: struct x {...} typedef y; This fixes PR6208. llvm-svn: 95094
* improve diagnostics for C++ struct ; issues. Before:Chris Lattner2010-02-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | t.cc:4:3: error: expected ';' at end of declaration list int y; ^ t.cc:6:1: error: expected ';' at end of declaration list }; ^ After: t.cc:3:8: error: expected ';' at end of declaration list int x ^ ; t.cc:5:8: error: expected ';' at end of declaration list int z ^ ; llvm-svn: 95039
* improve diagnostics on missing ; in a struct. Before:Chris Lattner2010-02-021-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | t.c:4:3: error: expected ';' at end of declaration list int y; ^ t.c:4:8: warning: extra ';' inside a struct or union int y; ^ t.c:6:1: warning: expected ';' at end of declaration list }; ^ After: t.c:3:8: error: expected ';' at end of declaration list int x // expected-error {{expected ';' at end of declaration list}} ^ ; t.c:5:8: warning: expected ';' at end of declaration list int z ^ ; llvm-svn: 95038
* Insulate these from changes to the default for -Wunreachable-code.Mike Stump2010-01-231-1/+1
| | | | llvm-svn: 94326
* Implement semantic checking for C++ literal operators.Alexis Hunt2010-01-131-3/+3
| | | | | | | This now rejects literal operators that don't meet the requirements. Templates are not yet checked for. llvm-svn: 93315
* Make sure to give an error for template argument lists followed by junk.Eli Friedman2009-12-271-0/+9
| | | | llvm-svn: 92177
* fix the microsoft "charify" extension to return the charified token Chris Lattner2009-12-231-0/+6
| | | | | | | as a character literal, not a string literal. This might fix rdar://7486575 llvm-svn: 92025
* fix PR5500: clang fails to parse inline asm with :: in C++ mode Chris Lattner2009-12-201-0/+6
| | | | llvm-svn: 91802
* Teach TryAnnotateTypeOrScopeToken to deal with already-annotatedJohn McCall2009-12-191-0/+40
| | | | | | | scope specifiers. Fix a tentative parsing bug that came up in LLVM. Incidentally fixes some random FIXMEs in an existing testcase. llvm-svn: 91734
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-1592-96/+96
| | | | | | | | | - 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
* Make tests use the new clang cc1 flag.Fariborz Jahanian2009-12-1424-25/+25
| | | | llvm-svn: 91300
* If we enter parens, colons can become un-sacred, allowing us to emitChris Lattner2009-12-101-1/+7
| | | | | | a better diagnostic in the second example. llvm-svn: 91040
* fix a more evil case of : / :: confusion arising in ?:.Chris Lattner2009-12-101-1/+7
| | | | llvm-svn: 91039
* fix incorrect parsing of bitfields pointed out by Doug. I choseChris Lattner2009-12-101-0/+9
| | | | | | | to use ColonProtectionRAIIObject in the C codepath even though it won't matter for consistency. llvm-svn: 91037
OpenPOWER on IntegriCloud