summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
Commit message (Collapse)AuthorAgeFilesLines
* <rdar://problem/13540921> Fix a crasher when an Objective-C for-in loop gets ↵Douglas Gregor2013-04-081-7/+16
| | | | | | a non-variable iteration declaration. llvm-svn: 179053
* Make the ObjC attributes diagnostics a bit more informative.Nico Weber2013-04-041-6/+10
| | | | llvm-svn: 178720
* Emit a nicer diagnostic for misplaced attributes on ObjC directives.Nico Weber2013-04-031-0/+15
| | | | llvm-svn: 178670
* Give the default CorrectionCandidateCallback::ValidateCandidate someKaelyn Uhrain2013-04-031-0/+1
| | | | | | | | smarts so that it doesn't approve of keywords and/or type names when it knows (based on its flags) that those kinds of corrections are not wanted. llvm-svn: 178668
* Enable use of _Static_assert inside structs and unions in C11 mode (as per ↵Andy Gibbs2013-04-031-0/+7
| | | | | | C11 6.7.2.1p1). llvm-svn: 178632
* Assert that Parser::ParseStructUnionBody is not called for C++ code.Andy Gibbs2013-04-031-3/+3
| | | | llvm-svn: 178631
* Objective-C arc [qui]. Don't issue the bridge castFariborz Jahanian2013-04-021-6/+10
| | | | | | | | warning when doing a __bride cast in non-arc mode (which has no retain count effect). // rdar://13514210 llvm-svn: 178592
* PR15633: Note that we are EnteringContext when parsing the nested nameRichard Smith2013-04-011-1/+1
| | | | | | | specifier for an enumeration. Also fix a crash-on-invalid if a non-dependent name specifier is used to declare an enum template. llvm-svn: 178502
* Support C11 _Atomic type qualifier. This is more-or-less just syntactic ↵Richard Smith2013-03-282-11/+35
| | | | | | sugar for the _Atomic type specifier. llvm-svn: 178210
* [Parser] Don't code-complete twice.Argyrios Kyrtzidis2013-03-274-5/+5
| | | | | | | | | | | | | | | When we are consuming the current token just to enter a new token stream, we push the current token in the back of the stream so that we get it again. Unfortunately this had the effect where if the current token is a code-completion one, we would code-complete once during consuming it and another time after the stream ended. Fix this by making sure that, in this case, ConsumeAnyToken() will consume a code-completion token without invoking code-completion. rdar://12842503 llvm-svn: 178199
* Implement compiler intrinsics needed for compatibility with MSVC 2012 ↵Joao Matos2013-03-272-0/+7
| | | | | | | | <type_traits>. Patch by me and Ryan Molden. llvm-svn: 178111
* Implement special-case name lookup for inheriting constructors: memberRichard Smith2013-03-262-13/+45
| | | | | | | using-declarations with names which look constructor-like are interpreted as constructor names. llvm-svn: 177957
* Try harder to be signal-safe inside our signal handler. The most prominent ↵Nick Lewycky2013-03-251-4/+15
| | | | | | | | | | behavioural difference is that we no longer clean the token before emitting it. This fixes a bug where clang hangs in the middle of crashing because the crash handler calls malloc from inside a crash that happened inside of free. llvm-svn: 177919
* OpenMP threadprivate directive parsing and semantic analysisAlexey Bataev2013-03-227-1/+197
| | | | llvm-svn: 177705
* Fix a crash-on-valid where a block capture copy expression wasJohn McCall2013-03-221-1/+1
| | | | | | | | | | | | picking up cleanups from earlier in the statement. Also fix a crash-on-invalid where a reference to an invalid decl from an enclosing scope was causing an expression to fail to build, but only *after* a cleanup was registered from that statement, causing an assertion downstream. The crash-on-valid is rdar://13459289. llvm-svn: 177692
* Do the error recovery for @end only.Fariborz Jahanian2013-03-201-4/+7
| | | | | | | | I am not sure how much we can improve for when a randon ObjC keyword is thrown into the ivar decl. block. // rdar://6854840 llvm-svn: 177553
* Objective-C [qoi] more gracefull recovery when Fariborz Jahanian2013-03-201-17/+28
| | | | | | | '}' is missing for the ivar declarations. // rdar://6854840 llvm-svn: 177549
* Teach statement / declaration disambiguation about C++11-style generalized ↵Richard Smith2013-03-201-7/+21
| | | | | | initializers. llvm-svn: 177480
* Objective-C [qoi]: Provide improved parse diagnostics whenFariborz Jahanian2013-03-191-0/+4
| | | | | | | | | closing rbrace is missing in an ObjC class declaration. Can do beter than this, but it involves addition of overhead which will be present in correct code. // rdar://6854840 llvm-svn: 177435
* Add missing diagnostic for a nested-name-specifier on a free-standing type ↵Richard Smith2013-03-181-2/+6
| | | | | | definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations. llvm-svn: 177335
* PR15290: 'this' is not permitted in the declaration of a friend function,Richard Smith2013-03-151-4/+6
| | | | | | | therefore references to members should not be transformed into implicit uses of 'this'. Patch by Ismail Pazarbasi! llvm-svn: 177134
* Flag that friend function definitions are "late parsed" so thatJohn McCall2013-03-141-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | template instantiation will still consider them to be definitions if we instantiate the containing class before we get around to parsing the friend. This seems like a legitimate use of "late template parsed" to me, but I'd appreciate it if someone responsible for the MS feature would look over this. This file already appears to access AST nodes directly, which is arguably not kosher in the parser, but the performance of this path matters enough that perpetuating the sin is justifiable. Probably we ought to reconsider this policy for very simple manipulations like this. The reason this entire thing is necessary is that function template instantiation plays some very gross games in order to not associate an instantiated function template with the class it came from unless it's a definition, and the reason *that's* necessary is that the AST currently cannot represent the instantiation history of individual function template declarations, but instead tracks it in common for the entire function template. That probably prevents us from correctly reporting ill-formed calls to ambiguously instantiated friend function templates. rdar://12350696 llvm-svn: 177003
* Remove unused variable.Benjamin Kramer2013-03-081-1/+0
| | | | llvm-svn: 176704
* Add support for the OpenCL attribute 'vec_type_hint'.Joey Gouly2013-03-081-10/+37
| | | | | | Patch by Murat Bolat! llvm-svn: 176686
* [Sema] Semantic analysis for empty-declaration and attribute-declaration.Michael Han2013-02-221-8/+4
| | | | | | | | Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these attributes can be sema checked just as attributes attached to "normal" declarations. llvm-svn: 175900
* Don't accidentally and silently accept C++11 attributes in decl-specifier-seqsRichard Smith2013-02-222-1/+3
| | | | | | in C++98. llvm-svn: 175879
* Per the grammar in [dcl.dcl]p1, a simple-declaration can only have attributesRichard Smith2013-02-222-8/+10
| | | | | | if it has declarators. We were missing the check for this in a couple of places. llvm-svn: 175876
* Handle alignas(foo...) pack expansions.Richard Smith2013-02-221-10/+4
| | | | llvm-svn: 175875
* Don't skip '_Alignas' when disambiguating 'final'. '_Alignas' can't appear here,Richard Smith2013-02-221-10/+3
| | | | | | and we used to assert if it did. llvm-svn: 175866
* [libclang] Fix a crash with invalid code, while skip function bodies is enabled.Argyrios Kyrtzidis2013-02-221-1/+1
| | | | llvm-svn: 175860
* Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,Richard Smith2013-02-222-2/+4
| | | | | | | | | | | to control the check for the C 5.2.4.1 / C++ [implimits] restriction on nesting levels for parentheses, brackets and braces. Some code with heavy macro use exceeds the default limit of 256, but we don't want to increase it generally to avoid stack overflow on stack-constrained systems. llvm-svn: 175855
* Use None rather than Optional<T>() where possible.David Blaikie2013-02-211-1/+1
| | | | llvm-svn: 175705
* Include llvm::Optional in clang/Basic/LLVM.hDavid Blaikie2013-02-202-5/+5
| | | | | | Post-commit CR feedback from Jordan Rose regarding r175594. llvm-svn: 175679
* PR15311: Finish implementation of the suggested resolution of core issue 1488,Richard Smith2013-02-201-0/+7
| | | | | | | | which allows grouping parens in an abstract-pack-declarator. This was already mostly implemented, but missed some cases. Add an ExtWarn for use of this extension until CWG ratifies it. llvm-svn: 175660
* Process and handle attributes on conditions and for loop variables. Process andRichard Smith2013-02-205-26/+32
| | | | | | | diagnose attributes on alias declarations, using directives, and attribute declarations. llvm-svn: 175649
* Don't repeat the function name in the comment.Richard Smith2013-02-201-4/+4
| | | | llvm-svn: 175586
* PR15300: Support C++11 attributes on base-specifiers. We don't support any suchRichard Smith2013-02-192-25/+44
| | | | | | | | attributes yet, so just issue the appropriate diagnostics. Also generalize the fixit for attributes-in-the-wrong-place code and reuse it here, if attributes are placed after the access-specifier or 'virtual' in a base specifier. llvm-svn: 175575
* When a statement is dropped from the AST because it was invalid, make sureArgyrios Kyrtzidis2013-02-151-5/+0
| | | | | | | we don't do the scope checks otherwise we are going to hit assertion checks since a label may not have been actually added. llvm-svn: 175281
* Accept over-qualified constructor in MSVC emulation modeDmitri Gribenko2013-02-121-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MSVC accepts this: class A { A::A(); }; Clang accepts regular member functions with extra qualification as an MS extension, but not constructors. This changes the parser to defer rejecting qualified constructors so that the same Sema logic can apply to constructors as regular member functions. This also improves the error message when MS extensions are disabled (in my opinion). Before it was: /Users/jason/Desktop/test.cpp:2:8: error: expected member name or ';' after declaration specifiers A::A(); ~~~~ ^ 1 error generated. After: /Users/jason/Desktop/test.cpp:2:6: error: extra qualification on member 'A' A::A(); ~~~^ 1 error generated. Patch by Jason Haslam. llvm-svn: 174980
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-083-5/+8
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. llvm-svn: 174768
* Thread safety analysis: make sure that expressions in attributes are parsedDeLesley Hutchins2013-02-071-0/+1
| | | | | | in an unevaluated context. llvm-svn: 174644
* Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei2013-02-073-0/+9
| | | | | | restrictions. llvm-svn: 174601
* Micro change: moved '{' for better readability (+don't confuse ↵Alexander Kornienko2013-02-011-5/+5
| | | | | | -Wimplicit-fallthrough) llvm-svn: 174202
* Provide a fixit for constexpr non-static data members.David Blaikie2013-01-301-3/+3
| | | | | | | | | | | | | | | | If the member has an initializer, assume it was probably intended to be static and suggest/recover with that. If the member doesn't have an initializer, assume it was probably intended to be const instead of constexpr and suggest that. (if the attempt to apply these changes fails, don't make any suggestion & produce the same diagnostic experience as before. The only case where this can come up that I know of is with a mutable constexpr with an initializer, since mutable is incompatible with static (but it's already incompatible with const anyway)) llvm-svn: 173873
* Produce a diagnostic if alignas is applied to an expression. Neither C11 norRichard Smith2013-01-291-3/+6
| | | | | | C++11 allows that. llvm-svn: 173789
* Downgrade 'attribute ignored when parsing type' from error to warning, to matchRichard Smith2013-01-292-4/+4
| | | | | | | | | the diagnostic's warn_ name. Switch some places (notably C++11 attributes) which really wanted an error over to a different diagnostic. Finally, suppress the diagnostic entirely for __ptr32, __ptr64 and __w64, to avoid producing diagnostics in important system headers. llvm-svn: 173788
* Implement C++11 [dcl.align]p1 and C11 6.7.5/2 rules for alignas and _Alignas.Richard Smith2013-01-292-7/+15
| | | | llvm-svn: 173779
* PR15017: A '>' can appear after a type-specifier in a template-argument-list.Richard Smith2013-01-291-0/+3
| | | | | | | It turns out that there's no correctness bug here (because we can't have a type definition in this location), but there was a diagnostic bug. llvm-svn: 173766
* Treat alignas and _Alignas as keyword attributes. This allows us toRichard Smith2013-01-291-10/+6
| | | | | | | pretty-print them properly (modulo the more general badness in alignment attribute printing). llvm-svn: 173752
* Replace AS_MSTypespec with AS_Keyword, for representing any attribute spelledRichard Smith2013-01-291-5/+7
| | | | | | | | | as a keyword. Rationalize existing attributes to use it as appropriate, and to not lie about some __declspec attributes being GNU attributes. In passing, remove a gross hack which was discarding attributes which we could handle. This results in us actually respecting the __pascal keyword again. llvm-svn: 173746
OpenPOWER on IntegriCloud