summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Diagnose mixed use of '_' and '.' as versionFariborz Jahanian2014-10-021-2/+7
| | | | | | separators in my previous patch. llvm-svn: 218895
* Patch to accept '_' in addition to '.' as versionFariborz Jahanian2014-10-021-3/+8
| | | | | | | number separator in "availability" attribute. rdar://18490958 llvm-svn: 218884
* -ms-extensions: Implement __super scope specifier (PR13236).Nikola Smiljanic2014-09-261-0/+1
| | | | | | | | | We build a NestedNameSpecifier that records the CXXRecordDecl in which __super appeared. Name lookup is performed in all base classes of the recorded CXXRecordDecl. Use of __super is allowed only inside class and member function scope. llvm-svn: 218484
* Parse: Replace polymorphic functor objects with lambdas and llvm::function_ref.Benjamin Kramer2014-09-031-23/+15
| | | | | | No change in functionality. llvm-svn: 217025
* PR20760: Don't assert (and produce better diagnostics) if a default initializerRichard Smith2014-08-271-2/+1
| | | | | | contains an unmatched closing bracket token. llvm-svn: 216518
* C++1y is now C++14!Aaron Ballman2014-08-191-1/+1
| | | | | | Changes diagnostic options, language standard options, diagnostic identifiers, diagnostic wording to use c++14 instead of c++1y. It also modifies related test cases to use the updated diagnostic wording. llvm-svn: 215982
* Reject virt-specifiers on friend declarations. Give anonymous bitfields aRichard Smith2014-08-121-1/+2
| | | | | | location so their diagnostics have somewhere to point. llvm-svn: 215416
* Reject varargs '...' in function prototype if there are more parameters afterRichard Smith2014-08-111-5/+36
| | | | | | | | | | | it. Diagnose with recovery if it appears after a function parameter that was obviously supposed to be a parameter pack. Otherwise, warn if it immediately follows a function parameter pack, because the user most likely didn't intend to write a parameter pack followed by a C-style varargs ellipsis. This warning can be syntactically disabled by using ", ..." instead of "...". llvm-svn: 215408
* Parser: Array decls with static but without array size are illformedDavid Majnemer2014-08-081-0/+5
| | | | | | | | | | | | Array declarators involving the static keyword take on two forms: D[ static type-qualifier-listopt assignment-expression ] D[ type-qualifier-list static assignment-expression ] Raise a diagnostic if the assignment-expression is missing. This fixes PR20584. llvm-svn: 215187
* Parse: Don't crash on trailing whitespace before EOFDavid Majnemer2014-07-261-1/+4
| | | | | | | | | | | | | | | Parser::ParseDeclarationSpecifiers eagerly updates the source range of the DeclSpec with the current token position. However, it might not consume any more tokens. Fix this by only setting the start of the range, not the end. This way the SourceRange will be invalid if we don't consume any more tokens. This fixes PR20413. Differential Revision: http://reviews.llvm.org/D4646 llvm-svn: 214018
* Disallowing GNU-style attributes in new expressions, since they are ↵Aaron Ballman2014-07-221-18/+27
| | | | | | prohibited by GCC as well. llvm-svn: 213650
* Avoid crash if default argument parsed with errors.Serge Pavlov2014-07-221-2/+2
| | | | | | | | | | | | | | If function parameters have default values, and that of the second parameter is parsed with errors, function declaration would have a parameter without default value that follows a parameter with that. Such declaration breaks logic of selecting overloaded function. As a solution, put opaque object as default value in such case. This patch fixes PR20055. Differential Revision: http://reviews.llvm.org/D4378 llvm-svn: 213594
* Parse: Diagnose malformed 'message' arguments for 'availability' attrDavid Majnemer2014-07-181-1/+12
| | | | | | | The parsing code for 'availability' wasn't prepared for string literals like "a" L"b" showing up. Error if this occurs. llvm-svn: 213350
* Removing a FIXME from the attribute parsing code by now passing along the ↵Aaron Ballman2014-07-161-31/+35
| | | | | | scope and syntax information for attributes with custom parsing. It turns out not to matter too much because the FIXME wasn't quite true -- none of these attributes have a C++11 spelling. However, it's still a good change (for instance, we may add an attribute with a type arg in the future for which this code now behaves properly). llvm-svn: 213191
* Improve error recovery around colon.Serge Pavlov2014-07-161-9/+18
| | | | | | | | | | | | Recognize additional cases, when '::' is mistyped as ':'. This is a fix to RP18587 - colons have too much protection in member-declarations Review is tracked by http://reviews.llvm.org/D3653. This is an attempt to recommit the fix, initially committed as r212957 but then reverted in r212965 as it broke self-build. In the updated patch ParseDirectDeclarator turns on colon protection in for context as well. llvm-svn: 213120
* Revert "Improve error recovery around colon."Reid Kleckner2014-07-141-15/+9
| | | | | | | | This reverts commit r212957. It broke the self-host on code like this from LLVM's option library: for (auto Arg: filtered(Id0, Id1, Id2)) llvm-svn: 212965
* Improve error recovery around colon.Serge Pavlov2014-07-141-9/+15
| | | | | | | | | Recognize additional cases, when '::' is mistyped as ':'. This is a fix to RP18587 - colons have too much protection in member-declarations. Differential Revision: http://reviews.llvm.org/D3653 llvm-svn: 212957
* Provide a better diagnostic when braces are put before the identifier.Richard Trieu2014-06-241-6/+116
| | | | | | | | | | | | | | | | | When a user types: int [4] foo; assume that the user means: int foo[4]; Update the information for 'foo' to prevent additional errors, and provide a fix-it hint to move the brackets to the correct location. Additionally, suggest parens for types that require it, such as: int [4] *foo; to: int (*foo)[4]; llvm-svn: 211641
* DiagnoseUnknownTypename always emits a diagnostic and returns trueReid Kleckner2014-06-191-32/+23
| | | | | | | | Make it return void and delete the dead code in the parser that handled the case where it might return false. This has been dead since 2010 when John deleted Action.h. llvm-svn: 211248
* MS static locals mangling: don't count enum scopesHans Wennborg2014-06-171-1/+1
| | | | | | | | | | We may not have the mangling for static locals vs. enums completely figured out, but at least for my simple test cases, enums should not increment the mangling number. Differential Revision: http://reviews.llvm.org/D4164 llvm-svn: 211078
* Delay lookup of simple default template arguments under -fms-compatibilityReid Kleckner2014-06-061-0/+12
| | | | | | | | | | | | | | | | | | MSVC delays parsing of default arguments until instantiation. If the default argument is never used, it is never parsed. We don't model this. Instead, if lookup of a type name fails in a template argument context, we form a DependentNameType, which will be looked up at instantiation time. This fixes errors about 'CControlWinTraits' in atlwin.h. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D3995 llvm-svn: 210382
* PR11306 - Variadic template fix-it suggestion. Recover from misplaced or ↵Nikola Smiljanic2014-06-061-15/+3
| | | | | | redundant ellipsis in parameter pack. llvm-svn: 210304
* Refactoring. Remove release and take methods from ActionResult. Rename ↵Nikola Smiljanic2014-05-291-14/+14
| | | | | | takeAs to getAs. llvm-svn: 209800
* [C++11] Use 'nullptr'. Parser edition.Craig Topper2014-05-211-57/+59
| | | | llvm-svn: 209275
* Replace a fake enum class with the real thing.Richard Smith2014-05-161-4/+4
| | | | llvm-svn: 208943
* Fix an outdated comment.Richard Smith2014-05-081-4/+3
| | | | llvm-svn: 208366
* Suggest fix-it ':' when '=' used in for-range-declarationIsmail Pazarbasi2014-05-081-7/+24
| | | | | | | | | | Fix for PR19176. Clang will suggest a fix-it hint for cases like: int arr[] = {1, 2, 3, 4}; for (auto i = arr) ^ : llvm-svn: 208299
* During parsing, update the range of the Declarator to include the identifier.Richard Trieu2014-05-051-0/+1
| | | | llvm-svn: 208011
* Wrap a few lines at 80 columns, change a confusing indent. No behavior change.Nico Weber2014-05-031-3/+2
| | | | llvm-svn: 207921
* Fix PR 19630, don't crash when file ends with whitespace.Richard Trieu2014-05-021-1/+2
| | | | llvm-svn: 207883
* Fixing a typo, updating the diagnostic wording and logic based on ↵Aaron Ballman2014-04-151-1/+1
| | | | | | post-commit review feedback. Amends r206186. llvm-svn: 206229
* Properly diagnose Microsoft __declspec attributes which have optional ↵Aaron Ballman2014-04-141-2/+13
| | | | | | | | | | argument lists when the arguments are elided. eg) __declspec(deprecated()) // error __declspec(deprecated) // OK __declspec(deprecated("")) // OK llvm-svn: 206191
* Properly diagnose standard C++ attributes which have optional argument lists ↵Aaron Ballman2014-04-141-2/+4
| | | | | | | | | | | when the arguments are elided. eg) [[deprecated()]] // error [[deprecated]] // OK [[deprecated("")]] // OK [[gnu::deprecated()]] // OK llvm-svn: 206186
* Unify __declspec attribute argument parsing with the common attribute ↵Aaron Ballman2014-03-311-109/+51
| | | | | | | | argument parsing code. This removes a diagnostic that is no longer required (the semantic engine now properly handles attribute syntax so __declspec and __attribute__ spellings no longer get mismatched). This caused several testcases to need updating for a slightly different wording. llvm-svn: 205234
* Introduced an attribute syntax-neutral method for parsing attribute ↵Aaron Ballman2014-03-311-52/+61
| | | | | | arguments that is currently being used by GNU and C++-style attributes. This allows C++11 attributes with argument lists to be handled properly, fixing the "deprecated", "type_visibility", and capability-related attributes with arguments. llvm-svn: 205226
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-121-1/+1
| | | | | | class. llvm-svn: 203641
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-2/+2
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* [cleanup] Re-sort includes with llvm/utils/sort_includes.py and fixChandler Carruth2014-03-041-1/+1
| | | | | | | | | | | | a missing include from CLog.h. CLog.h referenced most of the core libclang types but never directly included Index.h that provides them. Previously it got lucky and other headers were always included first but with the sorting it ended up first in one case and stopped compiling. Adding the Index.h include fixes it right up. llvm-svn: 202810
* Improve diagnostics for malformed constructor declarations (where lookup forRichard Smith2014-03-031-7/+30
| | | | | | the type of the first parameter fails, and it is the only, unnamed, parameter). llvm-svn: 202759
* argument -> parameter terminology fixes for FunctionTypeInfoAlp Toker2014-02-261-2/+2
| | | | | | This is a continuation of r199686. llvm-svn: 202307
* Do not add enums to prototype scope in C++ modes.Peter Collingbourne2014-02-221-3/+0
| | | | | | | | | | | | | | The language forbids defining enums in prototypes, so this check is normally redundant, but if an enum is defined during template instantiation it should not be added to the prototype scope. While at it, clean up the code that deals with tag definitions in prototype scope and expand the visibility warning to cover the case where an anonymous enum is defined. Differential Revision: http://llvm-reviews.chandlerc.com/D2742 llvm-svn: 201927
* Enable correcting a member declaration where the type is class template,Kaelyn Uhrain2014-02-131-1/+3
| | | | | | | | | and the class name is shadowed by another member. Recovery still needs to be figured out, which is non-trivial since the parser has already gone down a much different path than if it had recognized the class template as type instead of seeing the member that shadowed the class template. llvm-svn: 201360
* Consolidating several table-generated files containing parser-related string ↵Aaron Ballman2014-01-291-4/+12
| | | | | | | | switches into a single file. This reduces build-related complexity by replacing four separate projects (and table-gen instantiations) with a single one. No functional changes intended. llvm-svn: 200424
* Add a new attribute meta-spelling called "GCC" -- it widens into being a GNU ↵Aaron Ballman2014-01-271-1/+1
| | | | | | | | spelling, and a CXX11 spelling with the namespace "gnu". It also sets a bit on the spelling certifying that it is known to GCC. From this, we can warn about the extension appropriately. As a consequence, the FunctionDefinition functionality is completely removed. Replacing the functionality from r199676, which didn't solve the problem as elegantly. llvm-svn: 200252
* Remove some hard-coded specialness for thread-safety attributes from the ↵Aaron Ballman2014-01-201-34/+7
| | | | | | parser, and made it more declarative. If an attribute is allowed to appear on a function definition when late parsed, it can now use the FunctionDefinition attribute subject. It's treated as a FunctionDecl for most purposes, except it also gets exposed on the AttributeList so that it can be used while parsing. llvm-svn: 199676
* Don't allow 'this' within typedefs within classes that otherwise look like theyRichard Smith2014-01-171-0/+1
| | | | | | might be member function declarations. Patch by Harald van Dijk! llvm-svn: 199512
* Fix for PR9812: warn about bool instead of _Bool.Erik Verbruggen2014-01-151-48/+58
| | | | llvm-svn: 199311
* Simplifying the OpenCL image attribute. It does not need a semantic integer ↵Aaron Ballman2014-01-141-26/+2
| | | | | | parameter because the required information is encoded in the spelling. Added an appropriate subject to the attribute, and simplified the semantic checking (which will likely be expanded upon in a future patch). Also, removed the GNU spelling since it was unsupported in the first place. llvm-svn: 199229
* Removing some attribute magic related to the OpenCL keyword attributes. ↵Aaron Ballman2014-01-141-38/+17
| | | | | | Instead of mapping them to their semantics as a custom part of the parser, they instead map declaratively through the rest of the attribute system. llvm-svn: 199175
* __forceinline is a keyword, and not a GNU-style attribute. This FIXME ↵Aaron Ballman2014-01-131-3/+1
| | | | | | appears to be out-dated, and the attribute syntax is becoming more important these days. llvm-svn: 199143
OpenPOWER on IntegriCloud