summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser
Commit message (Collapse)AuthorAgeFilesLines
...
* Objective-C [qoi] more gracefull recovery when Fariborz Jahanian2013-03-201-4/+10
| | | | | | | '}' is missing for the ivar declarations. // rdar://6854840 llvm-svn: 177549
* Teach statement / declaration disambiguation about C++11-style generalized ↵Richard Smith2013-03-201-0/+16
| | | | | | initializers. llvm-svn: 177480
* Objective-C [qoi]: Provide improved parse diagnostics whenFariborz Jahanian2013-03-191-0/+6
| | | | | | | | | 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-182-1/+16
| | | | | | 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
* Add quotation marks to template names in diagnostics.David Blaikie2013-03-051-3/+3
| | | | llvm-svn: 176474
* Fix warning text of my last patch.Fariborz Jahanian2013-02-281-1/+1
| | | | | | // rdar://13158394 llvm-svn: 176308
* objective-C: clang, following gcc, warns onFariborz Jahanian2013-02-281-1/+1
| | | | | | | | use of stand-alone protocol as type and uses id<proto>. Modify warning to say what compiler is doing. // rdar//13158394 llvm-svn: 176303
* [Sema] Semantic analysis for empty-declaration and attribute-declaration.Michael Han2013-02-221-1/+2
| | | | | | | | 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-221-0/+3
| | | | | | in C++98. llvm-svn: 175879
* Per the grammar in [dcl.dcl]p1, a simple-declaration can only have attributesRichard Smith2013-02-221-0/+5
| | | | | | if it has declarators. We were missing the check for this in a couple of places. llvm-svn: 175876
* Don't skip '_Alignas' when disambiguating 'final'. '_Alignas' can't appear here,Richard Smith2013-02-221-0/+3
| | | | | | and we used to assert if it did. llvm-svn: 175866
* Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,Richard Smith2013-02-221-1/+13
| | | | | | | | | | | 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
* PR15311: Finish implementation of the suggested resolution of core issue 1488,Richard Smith2013-02-201-1/+4
| | | | | | | | 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-201-6/+16
| | | | | | | diagnose attributes on alias declarations, using directives, and attribute declarations. llvm-svn: 175649
* PR15300: Support C++11 attributes on base-specifiers. We don't support any suchRichard Smith2013-02-193-22/+32
| | | | | | | | 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
* PR15132: Replace "address expression must be an lvalue or a functionRichard Smith2013-02-021-1/+1
| | | | | | | | | | | | | | designator" diagnostic with more correct and more human-friendly "cannot take address of rvalue of type 'T'". For the case of & &T::f, provide a custom diagnostic, rather than unhelpfully saying "cannot take address of rvalue of type '<overloaded function type>'". For the case of &array_temporary, treat it just like a class temporary (including allowing it as an extension); the existing diagnostic wording for the class temporary case works fine. llvm-svn: 174262
* Downgrade 'attribute ignored when parsing type' from error to warning, to matchRichard Smith2013-01-292-4/+6
| | | | | | | | | 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-291-1/+1
| | | | llvm-svn: 173779
* PR15017: A '>' can appear after a type-specifier in a template-argument-list.Richard Smith2013-01-291-0/+4
| | | | | | | 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-1/+1
| | | | | | | pretty-print them properly (modulo the more general badness in alignment attribute printing). llvm-svn: 173752
* Give a more informative error message when the dot or arrow operator is usedRichard Trieu2013-01-261-0/+18
| | | | | | | on a type. Currently, it gives a generic "expected unqualified-id" error. The new error message is "cannot use (dot|arrow) operator on a type". llvm-svn: 173556
* Temporarily disabling ms-asm testRenato Golin2013-01-251-0/+1
| | | | llvm-svn: 173510
* Fail these tests in a way that doesn't cause unexpected successes, per Daniel'sChad Rosier2013-01-241-0/+1
| | | | | | suggestion. llvm-svn: 173367
* Add a triple, per Ben's suggestion.Chad Rosier2013-01-221-2/+1
| | | | llvm-svn: 173198
* Second attempt to fix ppc bots.Chad Rosier2013-01-221-1/+1
| | | | llvm-svn: 173193
* Add x86 requirement to hopefully fix ppc bots.Chad Rosier2013-01-221-0/+1
| | | | llvm-svn: 173190
* [ms-inline asm] Remove a warning about ms-style inline assembly not beingChad Rosier2013-01-222-15/+15
| | | | | | supported. llvm-svn: 173177
* Fix five more cases of tokens which can legally follow a type specifier.Richard Smith2013-01-192-1/+38
| | | | llvm-svn: 172886
* Fix parsing of class specifiers before '\n' 'operator'.Nico Weber2013-01-181-0/+18
| | | | | | | | | | | | | r159549 / r159164 regressed clang to reject struct s {}; struct s operator++(struct s a) { return a; } This fixes the regression. Richard, pleas check if this looks right. llvm-svn: 172834
* Parsing support for C11's _Noreturn keyword. No semantics yet.Richard Smith2013-01-171-0/+14
| | | | llvm-svn: 172761
* Implement C++11 semantics for [[noreturn]] attribute. This required splittingRichard Smith2013-01-172-5/+8
| | | | | | | | it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as affecting the function type, whereas [[noreturn]] does not). llvm-svn: 172691
* Add a test for -Wsemicolon-before-method-body fixitDmitri Gribenko2013-01-151-0/+22
| | | | llvm-svn: 172545
* PR14918: Don't confuse braced-init-lists after template variable declarationsRichard Smith2013-01-151-0/+11
| | | | | | | | | | | with function definitions. We really should remove Parser::isDeclarationAfterDeclarator entirely, since it's meaningless in C++11 (an open brace could be either a function definition or an initializer, which is what it's trying to differentiate between). The other caller of it happens to be correct right now... llvm-svn: 172510
* Fix behavior of [[gnu::]] function attributes. Per g++'s behavior, theseRichard Smith2013-01-151-1/+1
| | | | | | | | | | | attributes appertain to a declaration, even though they would be much more naturally modelled as appertaining to a function type. Previously, we would try to distribute them from the declarator to the function type, then reject them for being at an incorrect location. Now, we just distribute them as far as the declarator; the existing attribute handling code can actually apply them there just fine. llvm-svn: 172504
* Accept [[gnu::*]] for all __attribute__((*))s which are:Richard Smith2013-01-141-3/+7
| | | | | | | | | | | 1) Supported by Clang, and 2) Supported by GCC, and 3) Documented in GCC's manual. g++ allows its C++11-style attributes to appertain only to the entity being declared, and never to a type (even for a type attribute), so we do the same. llvm-svn: 172382
* *this is const in a trailing-return-type for a constexpr member function.Richard Smith2013-01-141-0/+8
| | | | llvm-svn: 172375
* PR14855: don't silently swallow a nested-name-specifier after a type name.Richard Smith2013-01-081-0/+2
| | | | llvm-svn: 171908
* Add fixit hints for misplaced C++11 attributes around class specifiers.Michael Han2013-01-071-1/+0
| | | | | | | | | | Following r168626, in class declaration or definition, there are a combination of syntactic locations where C++11 attributes could appear, and among those the only valid location permitted by standard is between class-key and class-name. So for those attributes appear at wrong locations, fixit is used to move them to expected location and we recover by applying them to the class specifier. llvm-svn: 171757
* Re-commit r170428 changes with Linux style file endings.Guy Benyei2012-12-181-2/+0
| | | | | | Add OpenCL images as clang builtin types. llvm-svn: 170432
* Revert changes from r170428, as I accidentally changed the line endings of ↵Guy Benyei2012-12-181-14/+16
| | | | | | these files to Windows style. llvm-svn: 170431
* Add OpenCL images as clang builtin types.Guy Benyei2012-12-181-16/+14
| | | | llvm-svn: 170428
* Don't require a space between the two ">" in "vector<id<protocol>>" in objc++11.Nico Weber2012-12-141-0/+15
| | | | | | | | C++11 allowed writing "vector<vector<int>>" without a space between the two ">". This change allows this for protocols in template lists too in -std=c++11 mode, and improves the diagnostic in c++98 mode. llvm-svn: 170223
* PR14549. Don't assert if we see an incomplete decltype specifier at the end ↵Richard Smith2012-12-091-0/+3
| | | | | | of the file. llvm-svn: 169688
* [driver, ms-inline asm] Have -fms-extensions enable the AsmBlocks languageChad Rosier2012-12-051-0/+9
| | | | | | | | option. MS-style inline asm can now be enabled by either -fasm-blocks or -fms-extensions. rdar://12808010 llvm-svn: 169445
* [driver, ms-inline asm] MS-Style inline assembly is controlled by theChad Rosier2012-12-052-10/+1
| | | | | | | -fasm-blocks flag, not the -fms-extensions flag. rdar://12808010 llvm-svn: 169422
* In C++, if we hit an error in the class-head, don't try to parse the class body.Richard Smith2012-12-052-2/+7
| | | | | | | Our error recovery path may have made the class anonymous, and that has a pretty disastrous impact on any attempt to parse a class body containing constructors. llvm-svn: 169374
* Implement C++11 [dcl.attr.grammar] p4: If an attribute-specifier-seq ↵Michael Han2012-11-281-1/+7
| | | | | | appertains to a friend declaration, that declaration shall be a definition. llvm-svn: 168826
* Improve diagnostic on C++11 attribute specifiers that appear at wrong ↵Michael Han2012-11-261-0/+23
| | | | | | | | | | | | | syntactic locations around class specifiers. This change list implemented logic that explicitly detects several combinations of locations where C++11 attribute specifiers might be incorrectly placed within a class specifier. Previously we emit generic diagnostics like "expected identifier" for such cases; now we emit specific diagnostic against the misplaced attributes, this also fixed a bug in old code where attributes appear at legitimate locations were incorrectly rejected. Thanks to Richard Smith for reviewing! llvm-svn: 168626
* Made the "expected string literal" diagnostic more expressiveAndy Gibbs2012-11-171-1/+1
| | | | llvm-svn: 168267
* PR9903: Recover from a member functon declared with the 'typedef' specifier byRichard Smith2012-11-152-1/+14
| | | | | | | dropping the specifier, just like we do for non-member functions and function templates declared 'typedef'. Patch by Brian Brooks! llvm-svn: 168108
OpenPOWER on IntegriCloud