summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser
Commit message (Collapse)AuthorAgeFilesLines
...
* Teach Clang parser to reject C++11 attributes that appertain to declaration ↵Michael Han2012-11-061-0/+7
| | | | | | | | | specifiers. We don't support any C++11 attributes that appertain to declaration specifiers so reject the attributes in parser until we support them; this also conforms to what g++ 4.8 is doing. llvm-svn: 167481
* Our style for diagnostic messages is to not include a trailing dot.Matt Beaumont-Gay2012-11-051-1/+1
| | | | llvm-svn: 167379
* Test case for r167363.Lang Hames2012-11-041-0/+5
| | | | llvm-svn: 167369
* Fix test cases I broken when fixing grammar in diagnostic message.Richard Trieu2012-11-021-8/+8
| | | | llvm-svn: 167320
* When finding a '(' after '::', emit error with hint to remove '(' and matchingRichard Trieu2012-11-021-0/+22
| | | | | | | ')', if found. Don't crash. Fixes PR11852. llvm-svn: 167268
* Fix crash on missing namespace name in namespace alias definition -- PR14085.Nico Weber2012-10-271-0/+4
| | | | | | Patch from Brian Brooks <brooks.brian@gmail.com>! llvm-svn: 166893
* Correct test inovocations to use %clang_cc1 rather than direct invocation ↵David Tweed2012-10-251-1/+1
| | | | | | (so that it can have additional options set when trying to debug issues causing regressions). llvm-svn: 166681
* 'constexpr' and 'friend' are both declaration specifiers. Teach the parser ↵Richard Smith2012-10-251-1/+4
| | | | | | this, for better error recovery. llvm-svn: 166645
* Update regression tests for r166617.Eli Friedman2012-10-241-1/+1
| | | | llvm-svn: 166619
* Fix typo, make test case slightly more reabable. Thanks to Dmitri Gribenko forLang Hames2012-10-211-1/+2
| | | | | | the suggestions. llvm-svn: 166400
* When used in a compound expression FP_CONTRACT should proceed all explicitLang Hames2012-10-211-0/+6
| | | | | | | declarations and statements. Emit an error if the FP_CONTRACT is used later in a compound statement. llvm-svn: 166383
* DR1473: Do not require a space between operator"" and the ud-suffix in aRichard Smith2012-10-201-1/+2
| | | | | | literal-operator-id. llvm-svn: 166373
* Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs2012-10-1921-0/+21
| | | | | | VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. llvm-svn: 166280
* DR1528: C++11 doesn't allow repeated cv-qualifiers in declarators after all.Richard Smith2012-10-171-6/+8
| | | | llvm-svn: 166152
* Handle a "#pragma options align" inside a class.Argyrios Kyrtzidis2012-10-121-0/+5
| | | | llvm-svn: 165810
* Improve C++11 attribute parsing.Michael Han2012-10-033-35/+79
| | | | | | | | - General C++11 attributes were previously parsed and ignored. Now they are parsed and stored in AST. - Add support to parse arguments of attributes that in 'gnu' namespace. - Differentiate unknown attributes and known attributes that can't be applied to statements when emitting diagnostic. llvm-svn: 165082
* Cleaning up the self initialization checker.Richard Trieu2012-10-011-4/+5
| | | | | | | | | | | -Allow Sema to do more processing on the initial Expr before checking it. -Remove the special conditions in HandleExpr() -Move the code so that only one call site is needed. -Removed the function from Sema and only call it locally. -Warn on potentially evaluated reference variables, not just casts to r-values. -Update tests. llvm-svn: 164951
* If a comma operator is followed by a token which unambiguously indicates theRichard Smith2012-09-183-0/+38
| | | | | | | | start of a statement or the end of a compound-statement, diagnose the comma as a typo for a semicolon. Patch by Ahmed Bougacha! Additional test cases and minor refactoring by me. llvm-svn: 164085
* Recover properly after a parse error in a static_assert declaration.Richard Smith2012-09-131-0/+2
| | | | llvm-svn: 163826
* PR13775: When checking for a tag type being shadowed by some other declaration,Richard Smith2012-09-061-0/+14
| | | | | | don't trample over the caller's LookupResult in the case where the check fails. llvm-svn: 163281
* Revert r163083 per chandlerc's request.Joao Matos2012-09-041-6/+0
| | | | llvm-svn: 163149
* Implemented parsing and AST support for the MS __leave exception statement. ↵Joao Matos2012-09-021-0/+6
| | | | | | Also a minor fix to __except printing in StmtPrinter.cpp. Thanks to Aaron Ballman for review. llvm-svn: 163083
* Normalize line endings of r163013 (part 2).Joao Matos2012-08-311-44/+44
| | | | llvm-svn: 163032
* Improved MSVC __interface support by adding first class support for it, ↵Joao Matos2012-08-311-13/+21
| | | | | | instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins. llvm-svn: 163013
* Change the representation of builtin functions in the ASTEli Friedman2012-08-311-1/+1
| | | | | | | | | (__builtin_* etc.) so that it isn't possible to take their address. Specifically, introduce a new type to represent a reference to a builtin function, and a new cast kind to convert it to a function pointer in the operand of a call. Fixes PR13195. llvm-svn: 162962
* PR13652: Don't assume the parameter array on a FunctionTypeLoc for a lambda willRichard Smith2012-08-301-0/+1
| | | | | | | be filled in; they won't if the lambda's declarator has an invalid type. Instead take the parameters from the declarator directly. llvm-svn: 162904
* Splitting the duplicated decl spec extension warning into two: one is an ↵Aaron Ballman2012-08-282-1/+5
| | | | | | ExtWarn and the other a vanilla warning. This addresses PR13705, where const char const * wouldn't warn unless -pedantic was specified under the right conditions. llvm-svn: 162793
* [ms-inline asm] Change the -fenable-experimental-ms-inline-asm option from a Chad Rosier2012-08-241-4/+4
| | | | | | | | | CodeGen option to a LangOpt option. In turn, hoist the guard into the parser so that we avoid the new (and fairly unstable) Sema/AST/CodeGen logic. This should restore the behavior of clang to that prior to r158325. <rdar://problem/12163681> llvm-svn: 162602
* When disambiguating an expression-statement from a declaraton-statement, if theRichard Smith2012-08-231-0/+3
| | | | | | | statement starts with an identifier for which name lookup will fail either way, look at later tokens to disambiguate in order to improve error recovery. llvm-svn: 162464
* PR13619: Make sure we're not at EOF before looking at NextToken().Richard Smith2012-08-201-0/+3
| | | | llvm-svn: 162212
* PR41111, PR5925, PR13210: Teach tentative parsing to annotate identifiers andRichard Smith2012-08-183-5/+24
| | | | | | | | | | | | | | | | | nested names as id-expressions, using the annot_primary_expr annotation, where possible. This removes some redundant lookups, and also allows us to typo-correct within tentative parsing, and to carry on disambiguating past an identifier which we can determine will fail lookup as both a type and as a non-type, allowing us to disambiguate more declarations (and thus offer improved error recovery for such cases). This also introduces to the parser the notion of a tentatively-declared name, which is an identifier which we *might* have seen a declaration for in a tentative parse (but only if we end up disambiguating the tokens as a declaration). This is necessary to correctly disambiguate cases where a variable is used within its own initializer. llvm-svn: 162159
* [ms-inline asm] MSVC parses multiple __asm statements on a single line as oneChad Rosier2012-08-151-2/+2
| | | | | | | | | | | | statement. For example, if (x) __asm out dx, ax __asm out dx, ax results in a single inline asm statement (i.e., both "out dx, ax" statements are predicated on if(x)). llvm-svn: 161986
* [ms-inline asm] Add a helpful assert.Chad Rosier2012-08-141-5/+5
| | | | llvm-svn: 161890
* In 'delete []', the '[]' never starts a lambda. Update a FIXME with a ↵Richard Smith2012-08-091-0/+7
| | | | | | standard reference and add a test. llvm-svn: 161604
* Unify the codepaths for emitting deprecation warnings. The test changes are ↵Eli Friedman2012-08-081-3/+3
| | | | | | just to account for us emitting notes more consistently. llvm-svn: 161528
* Improvements to vexing-parse warnings. Make the no-parameters case moreRichard Smith2012-07-301-1/+2
| | | | | | | | | | | | | accurate by asking the parser whether there was an ambiguity rather than trying to reverse-engineer it from the DeclSpec. Make the with-parameters case have better diagnostics by using semantic information to drive the warning, improving the diagnostics and adding a fixit. Patch by Nikola Smiljanic. Some minor changes by me to suppress diagnostics for declarations of the form 'T (*x)(...)', which seem to have a very high false positive rate, and to reduce indentation in 'warnAboutAmbiguousFunction'. llvm-svn: 160998
* objective-c parsing. Don't crash when selector nameFariborz Jahanian2012-07-261-0/+52
| | | | | | is missing in method prototype. // rdar://11939584 llvm-svn: 160789
* Pedantic -pedantic correction. Duplicate cv-qualifiers are permitted in C++11Richard Smith2012-07-241-0/+3
| | | | | | unless they appear in a decl-specifier-seq. llvm-svn: 160688
* Do not warn about a function decl / direct init ambiguity if the function ↵Richard Smith2012-07-231-1/+3
| | | | | | has a trailing return type. llvm-svn: 160646
* Add diagnostics for comma at end of enum and for extra semicolon at namespaceRichard Smith2012-07-234-12/+39
| | | | | | | | scope to -Wc++11-extensions. Move extra semicolon after member function definition diagnostic out of -pedantic, since C++ allows a single semicolon there. Keep it in -Wextra-semi, though, since it's still questionable. llvm-svn: 160618
* Revert r160319, it caused PR13417. Add a test for PR13417.Nico Weber2012-07-201-0/+8
| | | | llvm-svn: 160542
* Better parser recovery in Objective-C containers.Jordan Rose2012-07-091-0/+64
| | | | | | | | | | | | | | Previously it was possible to get an infinite-loop-on-invalid with a namespace decl within @interface. Since 'namespace' is normally a safe place to retry top-level parsing, we just didn't consume the token. This adds a flag that tracks whether we have temporarily left Objective-C scope to parse a C-like declaration, and uses that to better recover from parse problems by stopping at possible method declarations and at @end. To fix the original problem, we do /not/ stop at 'namespace' when in an Objective-C @interface or @protocol context (but still do in @implementation). llvm-svn: 159941
* A ':' after an enum-specifier at class scope is a bitfield, not a typo for a ↵Richard Smith2012-07-021-0/+5
| | | | | | ';'. llvm-svn: 159549
* Add support for the C11 _Alignof keyword.Jordan Rose2012-06-301-1/+7
| | | | | | | This behaves like the existing GNU __alignof and C++11 alignof keywords; most of the patch is simply adding the third token spelling to various places. llvm-svn: 159494
* Support the use of "=delete" and "=default" with delayed templateDouglas Gregor2012-06-281-1/+12
| | | | | | parsing. Fixes <rdar://problem/11700604>. llvm-svn: 159380
* Extend the "expected ';' after struct" logic to also apply to enums, and toRichard Smith2012-06-251-1/+1
| | | | | | struct and enum forward-declarations. llvm-svn: 159164
* Recognize GNU attributes after 'enum class'. Fixes the libc++ build.John McCall2012-06-231-0/+5
| | | | llvm-svn: 159089
* Clean up a large number of C++11 attribute parse issues, including parsingAlexis Hunt2012-06-231-2/+128
| | | | | | | | | | | | | | | | | | attributes in more places where we didn't and catching a lot more issues. This implements nearly every aspect of C++11 attribute parsing, except for: - Attributes are permitted on explicit instantiations inside the declarator (but not preceding the decl-spec) - Attributes are permitted on friend declarations of functions. - Multiple instances of the same attribute in an attribute-list (e.g. [[noreturn, noreturn]], not [[noreturn]] [[noreturn]] which is conforming) are allowed. The first two are marked as expected-FIXME in the test file and the latter is probably a defect and is currently untested. Thanks to Richard Smith for providing the lion's share of the testcases. llvm-svn: 159072
* objective-c: improve diagnostic when collection expression isFariborz Jahanian2012-06-221-2/+2
| | | | | | not a pointer to a fast-enumerable object. // rdar://11488666 llvm-svn: 158998
* [ms-style asm] Change the fatal error to an extension warning. Apparently, thisChad Rosier2012-06-202-13/+13
| | | | | | | error was asserting on anything that included Windows.h. MS-style inline asm is still dropped, but at least now we're not completely silent about it. llvm-svn: 158833
OpenPOWER on IntegriCloud