summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* PR21437, final part of DR1330: delay-parsing of exception-specifications. ThisRichard Smith2014-11-131-7/+75
| | | | | | | is a re-commit of Doug's r154844 (modernized and updated to fit into current Clang). llvm-svn: 221918
* Updated the wording for a diagnostic to be more grammatically correct, and ↵Aaron Ballman2014-11-081-1/+6
| | | | | | use a %select. Also ensure that nested namespace definitions are diagnosed properly. Both changes are motivated by post-commit feedback from r221580. llvm-svn: 221581
* [c++1z] Support for attributes on namespaces and enumerators.Aaron Ballman2014-11-081-5/+11
| | | | llvm-svn: 221580
* [c++1z] Implement nested-namespace-definitions.Richard Smith2014-11-081-19/+18
| | | | | | | | | | | | | This allows 'namespace A::B { ... }' as a shorthand for 'namespace A { namespace B { ... } }'. We already supported this correctly for error recovery; promote that support to a full implementation. This is not the right implementation: we do not maintain source fidelity because we desugar the nested namespace definition in the parser. This is tricky to avoid, since the definition genuinely does inject one named entity per level in the namespace name. llvm-svn: 221574
* Remove a couple typedefs for things in the clang namespace with the same ↵Craig Topper2014-10-311-4/+4
| | | | | | name. Remove a typedef that matches an identical one in the clang namespace. llvm-svn: 220954
* -ms-extensions: Implement __super scope specifier (PR13236).Nikola Smiljanic2014-09-261-1/+8
| | | | | | | | | 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
* Suggest fix-it for missing '{' after base-clauseIsmail Pazarbasi2014-09-251-6/+36
| | | | llvm-svn: 218468
* Follow-up to r218292: Add more REVERTIBLE_TYPE_TRAITs.Nico Weber2014-09-241-2/+35
| | | | | | | | | r218292 reverted r197496 because it broke things. In addition to breaking things, r197496 also made all traits starting with __is_ revertible. Reinstantiate that part of r197496 because code out there (e.g. libc++) depends on this behavior. Fixes PR21045. llvm-svn: 218365
* Revert r197496, as it broke REVERTIBLE_TYPE_TRAITs from PCH files.Nico Weber2014-09-231-11/+25
| | | | | | Also add a test to make sure that this doesn't break again. Fixes PR21036. llvm-svn: 218292
* Don't crash on access decls with invalid scope specifier, PR20887.Nico Weber2014-09-101-0/+5
| | | | llvm-svn: 217472
* C++1y is now C++14!Aaron Ballman2014-08-191-2/+2
| | | | | | 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
* Uniformed parsing of GNU attributes at line beginnning and added GNU ↵Abramo Bagnara2014-08-161-0/+3
| | | | | | attributes parsing FIXMEs. llvm-svn: 215814
* PR20634: add some more cases that can legitimately come after a struct ↵Richard Smith2014-08-131-4/+7
| | | | | | declaration to our list of special cases. llvm-svn: 215520
* Reject virt-specifiers on friend declarations. Give anonymous bitfields aRichard Smith2014-08-121-4/+21
| | | | | | location so their diagnostics have somewhere to point. llvm-svn: 215416
* A static_assert declaration cannot be a template; adding the diagnostic for ↵Aaron Ballman2014-08-041-3/+4
| | | | | | this instead of silently accepting and producing possibly-unexpected behavior. llvm-svn: 214770
* Diagnose GNU-style attributes preceding virt-specifiers, but only when the ↵Aaron Ballman2014-08-041-3/+12
| | | | | | | | attribute is known to GCC. Clang accepts attributes in this position, but GCC does not, so this is a GCC-compat warning. If the attribute is not known to GCC, then the diagnostic is suppressed. llvm-svn: 214730
* Improve error recovery around colon.Serge Pavlov2014-07-161-15/+16
| | | | | | | | | | | | 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-16/+15
| | | | | | | | 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-15/+16
| | | | | | | | | 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
* [C++1z] Implement N3928: message in static_assert is optional.Richard Smith2014-06-201-14/+24
| | | | llvm-svn: 211394
* [c++1z] Implement N3994: a range-based for loop can declare a variable with ↵Richard Smith2014-06-191-8/+14
| | | | | | | | | | | | super-terse notation for (x : range) { ... } which is equivalent to for (auto &&x : range) { ... } llvm-svn: 211267
* PR19993: don't assert/crash if a static data member is initialized by '= ↵Richard Smith2014-06-111-2/+2
| | | | | | delete;'. llvm-svn: 210617
* Refactoring. Remove release and take methods from ActionResult. Rename ↵Nikola Smiljanic2014-05-291-9/+9
| | | | | | takeAs to getAs. llvm-svn: 209800
* Fix line endings.Nikola Smiljanic2014-05-281-9/+9
| | | | llvm-svn: 209727
* [C++11] Use 'nullptr'. Parser edition.Craig Topper2014-05-211-59/+63
| | | | llvm-svn: 209275
* Refactor all the checking for missing 'template<>'s when a declaration has aRichard Smith2014-04-171-12/+5
| | | | | | template-id after its scope specifier into a single place. llvm-svn: 206442
* Partial revert of r206229, to get the build bots green again.Aaron Ballman2014-04-151-8/+9
| | | | llvm-svn: 206237
* Fixing a typo, updating the diagnostic wording and logic based on ↵Aaron Ballman2014-04-151-5/+5
| | | | | | post-commit review feedback. Amends r206186. llvm-svn: 206229
* Properly diagnose standard C++ attributes which have optional argument lists ↵Aaron Ballman2014-04-141-9/+29
| | | | | | | | | | | when the arguments are elided. eg) [[deprecated()]] // error [[deprecated]] // OK [[deprecated("")]] // OK [[gnu::deprecated()]] // OK llvm-svn: 206186
* [MS-ABI] Add support for #pragma section and related pragmasWarren Hunt2014-04-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the msvc pragmas section, bss_seg, code_seg, const_seg and data_seg as well as support for __declspec(allocate()). Additionally it corrects semantics and adds diagnostics for __attribute__((section())) and the interaction between the attribute and the msvc pragmas and declspec. In general conflicts should now be well diganosed within and among these features. In supporting the pragmas new machinery for uniform lexing for msvc pragmas was introduced. The new machinery always lexes the entire pragma and stores it on an annotation token. The parser is responsible for parsing the pragma when the handling the annotation token. There is a known outstanding bug in this implementation in C mode. Because these attributes and pragmas apply _only_ to definitions, we process them at the time we detect a definition. Due to tentative definitions in C, we end up processing the definition late. This means that in C mode, everything that ends up in a BSS section will end up in the _last_ BSS section rather than the one that was live at the time of tentative definition, even if that turns out to be the point of actual definition. This issue is not known to impact anything as of yet because we are not aware of a clear use or use case for #pragma bss_seg but should be fixed at some point. Differential Revision=http://reviews.llvm.org/D3065#inline-16241 llvm-svn: 205810
* Render anonymous entities as '(anonymous <thing>)' (and lambdas as '(lambda ↵David Blaikie2014-04-021-1/+1
| | | | | | | | | | | | at ... )') For namespaces, this is consistent with mangling and GCC's debug info behavior. For structs, GCC uses <anonymous struct> but we prefer consistency between all anonymous entities but don't want to confuse them with template arguments, etc, so we'll just go with parens in all cases. llvm-svn: 205398
* Introduced an attribute syntax-neutral method for parsing attribute ↵Aaron Ballman2014-03-311-28/+52
| | | | | | 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
* [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
* Add [extern_c] attribute for modules, allowing a C module to be imported ↵Richard Smith2014-03-021-5/+36
| | | | | | within an extern "C" block in C++ code. llvm-svn: 202615
* argument -> parameter terminology fixes for FunctionTypeInfoAlp Toker2014-02-261-7/+6
| | | | | | This is a continuation of r199686. llvm-svn: 202307
* PR18870: Parse language linkage specifiers properly if the string-literal isRichard Smith2014-02-171-23/+14
| | | | | | spelled in an interesting way. llvm-svn: 201536
* MS ABI: Add support for #pragma pointers_to_membersDavid Majnemer2014-02-101-0/+5
| | | | | | | | | | | | | | | | | | | Introduce a notion of a 'current representation method' for pointers-to-members. When starting out, this is set to 'best case' (representation method is chosen by examining the class, selecting the smallest representation that would work given the class definition or lack thereof). This pragma allows the translation unit to dictate exactly what representation to use, similar to how the inheritance model keywords operate. N.B. PCH support is forthcoming. Differential Revision: http://llvm-reviews.chandlerc.com/D2723 llvm-svn: 201105
* Allow virt-specifiers after GNU attributes in member-declarators. GCC doesn'tRichard Smith2014-01-241-3/+9
| | | | | | | | | | | allow this, and we should warn on it, but it turns out that people were already relying on this. We should introduce a -Wgcc-compat warning for this if the attributes are known to GCC, but we don't currently track enough information about attributes to do so reliably. llvm-svn: 200045
* Factor out repeated parsing of a member-declarator when parsing aRichard Smith2014-01-231-69/+77
| | | | | | | | | | member-declaration. In the process, fix a couple of bugs that had crept in where we would parse the first and subsequent member-declarators differently (in particular, we didn't accept an asm-label on a member function definition within a class, and we would accept virt-specifiers and attributes in the wrong order on the first declarator but not on subsequent ones). llvm-svn: 199957
* Fix for PR9812: warn about bool instead of _Bool.Erik Verbruggen2014-01-151-9/+17
| | | | llvm-svn: 199311
* Add a new attribute 'enable_if' which can be used to control overload ↵Nick Lewycky2014-01-111-1/+1
| | | | | | resolution based on the values of the function arguments at the call site. llvm-svn: 198996
* TryConsume parser cleanupsAlp Toker2014-01-101-33/+14
| | | | | | Also move some comments into the block they were meant to describe. llvm-svn: 198935
* Implement isCXX11FinalKeyword() in terms of isCXX11VirtSpecifier()Alp Toker2014-01-091-34/+19
| | | | | | | | | | | | It's not worth keeping two copies of the identifier init and comparison code just to save a pointer coparison. This should reduce further once we get proper contextual keywords in the token stream, so having the identifier checks in one place is a step towards that. Cleanup only. llvm-svn: 198814
* PR18234: Mark a tag definition as invalid early if it appears in aRichard Smith2014-01-081-3/+4
| | | | | | | | type-specifier in C++. Some checks will assert in this case otherwise (in particular, the access specifier may be missing if this happens inside a class definition, due to a violation of an AST invariant). llvm-svn: 198721
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-071-1/+1
| | | | | | | encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. llvm-svn: 198686
* Simplify diagnostic tag type using the token kind formatterAlp Toker2014-01-061-7/+2
| | | | | | As far as the parser is concerned the tag type is always a keyword. llvm-svn: 198606
* Parse: Token consumption modernization and loop de-nestingAlp Toker2014-01-051-8/+4
| | | | | | Cleanup only. llvm-svn: 198539
* ExpectAndConsume: Diagnose errors automaticallyAlp Toker2014-01-011-22/+25
| | | | | | | | | | | | | | 1) Teach ExpectAndConsume() to emit expected and expected-after diagnostics using the generic diagnostic descriptions added in r197972, eliminating another set of trivial err_expected_* variations while maintaining existing behaviour. 2) Lift SkipUntil() recovery out of ExpectAndConsume(). The Expect/Consume family of functions are primitive parser operations that now have the well-defined property of operating on single tokens. Factoring out recovery exposes opportunities for more consistent and tailored error recover at the call sites instead of just relying on a bottled SkipUntil formula. llvm-svn: 198270
* Switch over more of the parser to err_expectedAlp Toker2013-12-301-17/+11
| | | | | | | Includes a fix for a missing highlight range caused by a ',' typo in the PP diagnostics. llvm-svn: 198252
* Support and use token kinds as diagnostic argumentsAlp Toker2013-12-241-11/+17
| | | | | | | | | | | | | | | | | | | Introduce proper facilities to render token spellings using the diagnostic formatter. Replaces most of the hard-coded diagnostic messages related to expected tokens, which all shared the same semantics but had to be multiply defined due to variations in token order or quote marks. The associated parser changes are largely mechanical but they expose commonality in whole chunks of the parser that can now be factored away. This commit uses C++11 typed enums along with a speculative legacy fallback until the transition is complete. Requires corresponding changes in LLVM r197895. llvm-svn: 197972
OpenPOWER on IntegriCloud