summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser
Commit message (Collapse)AuthorAgeFilesLines
...
* Using the quoted version of an attribute name for consistency with other ↵Aaron Ballman2014-01-021-6/+6
| | | | | | attribute diagnostics. llvm-svn: 198326
* Recover from errors in enum definitionSerge Pavlov2013-12-312-2/+36
| | | | | | | | | | Previously any error in enum definition body stopped parsing it. With this change parser tries to recover from errors. The patch fixes PR10982. Differential Revision: http://llvm-reviews.chandlerc.com/D2018 llvm-svn: 198259
* Implemented delayed processing of 'unavailable' checking, just like with ↵Ted Kremenek2013-12-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | 'deprecated'. Fixes <rdar://problem/15584219> and <rdar://problem/12241361>. This change looks large, but all it does is reuse and consolidate the delayed diagnostic logic for deprecation warnings with unavailability warnings. By doing so, it showed various inconsistencies between the diagnostics, which were close, but not consistent. It also revealed some missing "note:"'s in the deprecated diagnostics that were showing up in the unavailable diagnostics, etc. This change also changes the wording of the core deprecation diagnostics. Instead of saying "function has been explicitly marked deprecated" we now saw "'X' has been been explicitly marked deprecated". It turns out providing a bit more context is useful, and often we got the actual term wrong or it was not very precise (e.g., "function" instead of "destructor"). By just saying the name of the thing that is deprecated/deleted/unavailable we define this issue away. This diagnostic can likely be further wordsmithed to be shorter. llvm-svn: 197627
* Revert "Don't require -re suffix on -verify directives with regexes."Alp Toker2013-12-141-2/+2
| | | | | | | | | | This patch was submitted to the list for review and didn't receive a LGTM. (In fact one explicit objection and one query were raised.) This reverts commit r197295. llvm-svn: 197299
* Don't require -re suffix on -verify directives with regexes.Hans Wennborg2013-12-141-2/+2
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2392 llvm-svn: 197295
* Change semantics of regex expectations in the diagnostic verifierHans Wennborg2013-12-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Previously, a line like // expected-error-re {{foo}} treats the entirety of foo as a regex. This is inconvenient when matching type names containing regex characters. For example, to match "void *(class test8::A::*)(void)" inside such a regex, one would have to type "void \*\(class test8::A::\*\)\(void\)". This patch changes the semantics of expected-error-re to only treat the parts of the directive wrapped in double curly braces as regexes. This avoids the escaping problem and leads to nicer patterns for those cases; see e.g. the change to test/Sema/format-strings-scanf.c. (The balanced search for closing }} of a directive also makes us handle the full directive in test\SemaCXX\constexpr-printing.cpp:41 and :53.) Differential Revision: http://llvm-reviews.chandlerc.com/D2388 llvm-svn: 197092
* Parse: Avoid crashing on unterminated top-level asm stringsJustin Bogner2013-12-101-0/+13
| | | | | | | | | | | When parsing invalid top-level asm statements, we were ignoring the return code of the SkipUntil we used for recovery. This led to crashes when we hit the end of file and tried to continue parsing anyway. This fixes the crash and adds a couple of tests for parsing related problems. llvm-svn: 196961
* Avoid extra error messages if method definition is inside function.Serge Pavlov2013-12-091-0/+10
| | | | llvm-svn: 196757
* Re-enable ms inline asm parser test.Alp Toker2013-12-081-1/+1
| | | | | | LLVM r196044 should make it pass. llvm-svn: 196734
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-051-1/+1
| | | | llvm-svn: 196510
* Correct hyphenations in comments and assert messagesAlp Toker2013-12-051-8/+8
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. llvm-svn: 196466
* Parse: Recover better from bad definitions with base specifiersDavid Majnemer2013-12-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | We would skip until the next comma, hoping good things whould lie there, however this would fail when we have such things as this: struct A {}; template <typename> struct D; template <> struct D<C> : B, A::D; Once this happens, we would believe that D with a nested namespace specifier of A was a variable that was being declared. We would go on to complain that there was an extraneous 'template <>' on their variable declaration. Crashes would happen when 'A' gets defined as 'enum class A {}' as various asserts would fire. Instead, we should skip up until the semicolon if we see that we are in the middle of a definition and the current token is a ':' This fixes PR17084. llvm-svn: 196453
* ObjectiveC - Introducing objc_bridge_related attribute Fariborz Jahanian2013-12-041-0/+15
| | | | | | | | which specifies couple of (optional) method selectors for bridging a CFobject to or from an ObjectiveC object. This is wip. // rdsr://15499111 llvm-svn: 196408
* Fix PR17637: incorrect calculation of template parameter depthFaisal Vali2013-12-042-0/+78
| | | | | | In delayed template parsing mode, adjust the template depth counter for each template parameter list associated with an out of line member template specialization. llvm-svn: 196351
* add an additional test case for generic attributesSaleem Abdulrasool2013-11-301-0/+2
| | | | | | | | gcc treats [[gnu:const]], [[gnu::__const]], and [[gnu:__const__]] as all being equivalent. Add an additional test case to ensure that we do not miss the last case. llvm-svn: 195982
* Adding the Subjects entry back for the noreturn attributes. This caused some ↵Aaron Ballman2013-11-272-10/+10
| | | | | | test cases to be updated because the original diagnostic was about applying to methods as well as functions, but the semantic checking disallowed methods. llvm-svn: 195862
* __declspec(uuid) is only allowed on a class according to MSDN; this makes ↵Aaron Ballman2013-11-241-1/+1
| | | | | | the semantic checking consistent with what the attribute specifies in Attr.td. Also adds a test case. llvm-svn: 195579
* Fix new check for missing semicolon after struct definition to deal with theRichard Smith2013-11-201-0/+10
| | | | | | | case where the type in the following declaration is specified as a template-id, and refactor for clarity. llvm-svn: 195280
* PR9547: If we're parsing a simple-declaration that contains a tag definition,Richard Smith2013-11-192-2/+55
| | | | | | | | and we see an ill-formed declarator that would probably be well-formed if the tag definition were just missing a semicolon, use that as the diagnostic instead of producing some other mysterious error. llvm-svn: 195163
* PR17949: Fix crash if someone puts a namespace inside a class template.Richard Smith2013-11-151-0/+5
| | | | llvm-svn: 194872
* Diagnose C++11 attributes before fp_contract pragmas.Richard Smith2013-11-151-0/+5
| | | | llvm-svn: 194850
* Fix bogus diagnostic wording. There's no such thing as a compound expression.Richard Smith2013-11-151-1/+1
| | | | llvm-svn: 194849
* Warn on duplicate function specifierSerge Pavlov2013-11-131-0/+14
| | | | | | | | | This patch fixes PR8264. Duplicate qualifiers already are diagnozed, now the same diagnostics is issued for duplicate function specifiers. Differential Revision: http://llvm-reviews.chandlerc.com/D2025 llvm-svn: 194559
* Try to recover a bit better if a close brace is missing from the end of a classRichard Smith2013-11-091-0/+11
| | | | | | | definition. If we see something that looks like a namespace definition inside a class, that strongly indicates that a close brace was missing somewhere. llvm-svn: 194319
* Fix name in test.Rafael Espindola2013-11-081-1/+1
| | | | llvm-svn: 194291
* Fix %select numbering confusion between diagnostic and Diag call.Richard Smith2013-11-081-0/+1
| | | | llvm-svn: 194281
* Factor out custom parsing for iboutletcollection and vec_type_hint attributesRichard Smith2013-10-312-1/+4
| | | | | | | | | into a separate "parse an attribute that takes a type argument" codepath. This results in both codepaths being a lot cleaner and simpler, and fixes some bugs where the type argument handling bled into the expression argument handling and caused us to both accept invalid and reject valid attribute arguments. llvm-svn: 193731
* Add missing attributes [[gnu::no_sanitize_address]] andNick Lewycky2013-10-291-0/+7
| | | | | | [[gnu::no_address_safety_analysis]]. llvm-svn: 193583
* Treat [[gnu::__const]] the same as [[gnu::const]]. GCC's tokenizer can't tellNick Lewycky2013-10-291-0/+8
| | | | | | the difference. llvm-svn: 193582
* Fix a parser crash when there are #pragmas in a context which requires a singleRichard Smith2013-10-281-0/+27
| | | | | | statement (after a case label, if, etc). Patch by Olivier Goffart! llvm-svn: 193545
* Support GNU attributes in alias-declarations now that GCC has implemented themRichard Smith2013-10-241-0/+9
| | | | | | and we know where they go. llvm-svn: 193297
* PR17666: Instead of allowing an initial identifier argument in any attributeRichard Smith2013-10-241-0/+6
| | | | | | | | | | | | which we don't think can't have one, only allow it in the tiny number of attributes which opts into this weird parse rule. I've manually checked that the handlers for all these attributes can in fact cope with an identifier as the argument. This is still somewhat terrible; we should move more fully towards picking the parsing rules based on the attribute, and make the Parse -> Sema interface more type-safe. llvm-svn: 193295
* Parse: Disable delayed template parsing for constexpr functionsDavid Majnemer2013-10-231-0/+7
| | | | | | | | | | | | | | | Commit r191484 treated constexpr function templates as normal function templates with respect to delaying their parsing. However, this is unnecessarily restrictive because there is no compatibility concern with constexpr, MSVC doesn't support it. Instead, simply disable delayed template parsing for constexpr function templates. This largely reverts the changes made in r191484 but keeps it's unit test. This fixes PR17661. llvm-svn: 193274
* Revert r193073 and the attempt to fix it in r193170.Chandler Carruth2013-10-221-92/+0
| | | | | | | | | | This patch wasn't reviewed, and isn't correctly preserving the behaviors relied upon by QT. I don't have a direct example of fallout, but it should go through the standard code review process. For example, it should never have removed the QT test case that was added when fixing those users. llvm-svn: 193174
* Reenable 'break' in 'for' specifier to allow compilation of QT macro 'foreach'Serge Pavlov2013-10-221-5/+13
| | | | | | | | This is a fix to PR17649, caused by fix in r193073. QT uses 'break' statement to implement their 'foreach' macro. To enable build of QT, this fix reenables break but only in 'for' statement specifier and only in the third expression. llvm-svn: 193170
* Revert "Re-enable passing MS inline asm test."Reid Kleckner2013-10-211-0/+3
| | | | | | | | Microsoft inline asm crashes on the hexagon bot for unknown reasons. This reverts commit r193124. llvm-svn: 193128
* Re-enable passing MS inline asm test.Reid Kleckner2013-10-211-3/+0
| | | | llvm-svn: 193124
* Fix to PR8880 (clang dies processing a for loop).Serge Pavlov2013-10-211-0/+84
| | | | | | | | | | | | | | | | Due to statement expressions supported as GCC extension, it is possible to put 'break' or 'continue' into a loop/switch statement but outside its body, for example: for ( ; ({ if (first) { first = 0; continue; } 0; }); ) Such usage must be diagnosed as an error, GCC rejects it. To recognize this and similar patterns the flags BreakScope and ContinueScope are temporarily turned off while parsing condition expression. Differential Revision: http://llvm-reviews.chandlerc.com/D1762 llvm-svn: 193073
* Allow CorrectTypo to replace CXXScopeSpecifiers that refer to classes.Kaelyn Uhrain2013-10-192-5/+5
| | | | | | | | | | | Now that CorrectTypo knows how to correctly search classes for typo correction candidates, there is no good reason to only replace an existing CXXScopeSpecifier if it refers to a namespace. While the actual enablement was a matter of changing a single comparison, the fallout from enabling the functionality required a lot more code changes (including my two previous commits). llvm-svn: 193020
* Check "late parsed" friend functions for redefinitionAlp Toker2013-10-181-0/+4
| | | | | | | | | | | | | | | r177003 applied the late parsed template technique to friend functions but omitted the corresponding check for redefinitions. This patch adds the same check already in use for templates to the new code path in order to diagnose and reject invalid redefinitions that were being silently accepted. Fixes PR17324. Reviewed by Richard Smith. llvm-svn: 192948
* Tidy up and improve error recovery for C++11 attributes in bad places. Based onRichard Smith2013-10-151-0/+18
| | | | | | a patch by Michael Han. llvm-svn: 192666
* PR17567: Improve diagnostic for a mistyped constructor name. If we see somethingRichard Smith2013-10-152-0/+16
| | | | | | | | | | | that looks like a function declaration, except that it's missing a return type, try typo-correcting it to the relevant constructor name. In passing, fix a bug where the missing-type-specifier recovery codepath would drop a preceding scope specifier on the floor, leading to follow-on diagnostics and incorrect recovery for the auto-in-c++98 hack. llvm-svn: 192644
* Don't get confused by a virt-specifier after a trailing-return-type - it's notRichard Smith2013-10-131-0/+15
| | | | | | an accidentally-included name for the declarator. llvm-svn: 192559
* Parser: Avoid a crash-on-invalid when trying to diagnose function calls with ↵Benjamin Kramer2013-10-101-0/+6
| | | | | | | | -> in it. Use the existing convenience function. llvm-svn: 192347
* Make wording for certain invalid unary expressions more consistent.David Majnemer2013-10-091-4/+4
| | | | | | | | | | An invalid decltype expression like 'decltype int' gives: error: expected '(' after 'decltype' This makes it so 'sizeof int' gives a similar one: error: expected parentheses around type name in sizeof expression llvm-svn: 192258
* -Wmicrosoft: Don't warn on non-inline pure virtual method definitionsReid Kleckner2013-10-081-0/+9
| | | | | | | | | | | | | | | MSVC and clang with -fms-extensions allow pure virtual methods to be defined inline after the "= 0" tokens. Clang warns on these because it is not standard, but incorrectly warns on out-of-line definitions, which are standard. With this change, clang will only warn on inline definitions of pure virtual methods. Fixes some self-host warnings on out-of-line definitions of pure virtual destructors. llvm-svn: 192244
* Fixed messages in tests.Serge Pavlov2013-10-081-4/+4
| | | | llvm-svn: 192208
* Add fixits suggesting parenthesis around type name in expressions like sizeof.Serge Pavlov2013-10-081-0/+10
| | | | | | This fixes PR16992 - Fixit missing when "sizeof type" found. llvm-svn: 192200
* Add compat/extension warnings for init captures.Richard Smith2013-09-282-7/+7
| | | | llvm-svn: 191609
* Per latest drafting, switch to implementing init-captures as if by declaringRichard Smith2013-09-281-6/+4
| | | | | | and capturing a variable declaration, and complete the implementation of them. llvm-svn: 191605
OpenPOWER on IntegriCloud