summaryrefslogtreecommitdiffstats
path: root/lib/Parse/ParseDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Consume unexpected "template" keywords after "using"Richard Trieu2019-05-011-0/+14
| | | | | | | | | | | The parser was dealing with unexpected "template" keywords after "using" keywords too late and putting the parser into the wrong state, which could lead to a crash down the line. This change allows the parser to consume the bad "template" keywords earlier, and continue parsing as if "template" was never there to begin with for better error recovery. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359740 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++2a] Implement semantic restrictions for 'export' declarations.Richard Smith2019-04-221-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358932 91177308-0d34-0410-b5e6-96231b3b80d8
* PR41192: fix cases where "missing ';' after class" error wouldRichard Smith2019-04-161-0/+2
| | | | | | incorrectly fire. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358467 91177308-0d34-0410-b5e6-96231b3b80d8
* Adds `-ftime-trace` option to clang that produces Chrome `chrome://tracing` ↵Anton Afanasyev2019-03-301-0/+7
| | | | | | | | | | | | | | compatible JSON profiling output dumps. This change adds hierarchical "time trace" profiling blocks that can be visualized in Chrome, in a "flame chart" style. Each profiling block can have a "detail" string that for example indicates the file being processed, template name being instantiated, function being optimized etc. This is taken from GitHub PR: https://github.com/aras-p/llvm-project-20170507/pull/2 Patch by Aras Pranckevičius. Differential Revision: https://reviews.llvm.org/D58675 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357340 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Allow addr space spelling without __ prefix in C++.Anastasia Stulova2019-03-251-2/+7
| | | | | | | | | | | | | | | | For backwards compatibility we allow alternative spelling of address spaces - 'private', 'local', 'global', 'constant', 'generic'. In order to accept 'private' correctly, parsing has been changed to understand different use cases - access specifier vs address space. Fixes PR40707 and PR41011! Differential Revision: https://reviews.llvm.org/D59603 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356888 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeComplete] Propagate preferred type for function arguments in more casesIlya Biryukov2019-02-261-11/+11
| | | | | | | | | | | | | | | | | | | | | Summary: See the added test for some new cases. This change also removes special code completion calls inside the ParseExpressionList function now that we properly propagate expected type to the function responsible for parsing elements of the expression list (ParseAssignmentExpression). Reviewers: kadircet Reviewed By: kadircet Subscribers: xbolva00, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58541 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354864 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
* Use DeclSpec for quals in DeclaratorChunk::FunctionTypeInfo.Anastasia Stulova2019-01-091-22/+12
| | | | | | | | | | | | Rather than duplicating data fields, use DeclSpec directly to store the qualifiers for the functions/methods. This change doesn't handle attributes yet and has to be extended further. Differential revision: https://reviews.llvm.org/D55948 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350703 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix up diagnostics.Richard Trieu2018-12-141-1/+0
| | | | | | | | | | | | Move some diagnostics around between Diagnostic*Kinds.td files. Diagnostics used in multiple places were moved to DiagnosticCommonKinds.td. Diagnostics listed in the wrong place (ie, Sema diagnostics listed in DiagnosticsParseKinds.td) were moved to the correct places. One diagnostic split into two so that the diagnostic string is in the .td file instead of in code. Cleaned up the diagnostic includes after all the changes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349125 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Move storage of dispatch-version to GlobalDeclErich Keane2018-11-131-4/+5
| | | | | | | | | | | | | | | | | | | | As suggested by Richard Smith, and initially put up for review here: https://reviews.llvm.org/D53341, this patch removes a hack that was used to ensure that proper target-feature lists were used when emitting cpu-dispatch (and eventually, target-clones) implementations. As a part of this, the GlobalDecl object is proliferated to a bunch more locations. Originally, this was put up for review (see above) to get acceptance on the approach, though discussion with Richard in San Diego showed he approved of the approach taken here. Thus, I believe this is acceptable for Review-After-commit Differential Revision: https://reviews.llvm.org/D53341 Change-Id: I0a0bd673340d334d93feac789d653e03d9f6b1d5 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346757 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the 'fixit' for inline namespace replacement.Erich Keane2018-11-121-1/+4
| | | | | | | | | I'd neglected to add to the fixit for r346677. Richard Smith mentioned this in a review-after-commit, so fixing it here. Change-Id: I77e612be978d4eedda8d5bbd60b812b88f875cda git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346705 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement P1094R2 (nested inline namespaces)Erich Keane2018-11-121-41/+63
| | | | | | | | | As approved for the Working Paper in San Diego, support annotating inline namespaces with 'inline'. Change-Id: I51a654e11ffb475bf27cccb2458768151619e384 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346677 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce the _Clang scoped attribute token.Aaron Ballman2018-11-091-12/+32
| | | | | | Currently, we only accept clang as the scoped attribute identifier for double square bracket attributes provided by Clang, but this has the potential to conflict with user-defined macros. To help alleviate these concerns, this introduces the _Clang scoped attribute identifier as an alias for clang. It also introduces a warning with a fixit on the off chance someone attempts to use __clang__ as the scoped attribute (which is a predefined compiler identification macro). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346521 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix clang -Wimplicit-fallthrough warnings across llvm, NFCReid Kleckner2018-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch should not introduce any behavior changes. It consists of mostly one of two changes: 1. Replacing fall through comments with the LLVM_FALLTHROUGH macro 2. Inserting 'break' before falling through into a case block consisting of only 'break'. We were already using this warning with GCC, but its warning behaves slightly differently. In this patch, the following differences are relevant: 1. GCC recognizes comments that say "fall through" as annotations, clang doesn't 2. GCC doesn't warn on "case N: foo(); default: break;", clang does 3. GCC doesn't warn when the case contains a switch, but falls through the outer case. I will enable the warning separately in a follow-up patch so that it can be cleanly reverted if necessary. Reviewers: alexfh, rsmith, lattner, rtrieu, EricWF, bollu Differential Revision: https://reviews.llvm.org/D53950 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345882 91177308-0d34-0410-b5e6-96231b3b80d8
* NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)Erik Pilkington2018-10-301-1/+1
| | | | | | | | | | We haven't supported compiling ObjC1 for a long time (and never will again), so there isn't any reason to keep these separate. This patch replaces LangOpts::ObjC1 and LangOpts::ObjC2 with LangOpts::ObjC. Differential revision: https://reviews.llvm.org/D53547 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345637 91177308-0d34-0410-b5e6-96231b3b80d8
* Support accepting __gnu__ as a scoped attribute namespace that aliases to gnu.Aaron Ballman2018-10-241-7/+8
| | | | | | This is useful in libstdc++ to avoid clashes with identifiers in the user's namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345132 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeCompletion] Enable signature help when initializing class/struct/union ↵Kadir Cetinkaya2018-09-111-1/+15
| | | | | | | | | | | | | | | | | | | | members. Summary: Factors out member decleration gathering and uses it in parsing to call signature help. Doesn't support signature help for base class constructors, the code was too coupled with diagnostic handling, but still can be factored out but just needs more afford. Reviewers: sammccall, ilya-biryukov, ioeric Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51917 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341949 91177308-0d34-0410-b5e6-96231b3b80d8
* Append new attributes to the end of an AttributeList.Michael Kruse2018-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recommit of r335084 after revert in r335516. ... instead of prepending it at the beginning (the original behavior since implemented in r122535 2010-12-23). This builds up an AttributeList in the the order in which the attributes appear in the source. The reverse order caused nodes for attributes in the AST (e.g. LoopHint) to be in the reverse order, and therefore printed in the wrong order in -ast-dump. Some TODO comments mention this. The order was explicitly reversed for enable_if attribute overload resolution and name mangling, which is not necessary anymore with this patch. The change unfortunately has some secondary effect, especially on diagnostic output. In the simplest cases, the CHECK lines or expected diagnostic were changed to the the new output. If the kind of error/warning changed, the attributes' order was changed instead. This unfortunately causes some 'previous occurrence here' hints to be textually after the main marker. This typically happens when attributes are merged, but are incompatible to each other. Interchanging the role of the the main and note SourceLocation will also cause the case where two different declaration's attributes (in contrast to multiple attributes of the same declaration) are merged to be reverse. There is no easy fix because sometimes previous attributes are merged into a new declaration's attribute list, sometimes new attributes are added to a previous declaration's attribute list. Since 'previous occurrence here' pointing to locations after the main marker is not rare, I left the markers as-is; it is only relevant when the attributes are declared in the same declaration anyway. Differential Revision: https://reviews.llvm.org/D48100 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338800 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing spaceFangrui Song2018-07-301-32/+32
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338291 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Rename clang::AttributeList to clang::ParsedAttrErich Keane2018-07-131-16/+14
| | | | | | | | Since The type no longer contains the 'next' item anymore, it isn't a list, so rename it to ParsedAttr to be more accurate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337005 91177308-0d34-0410-b5e6-96231b3b80d8
* AttributeList de-listifying:Erich Keane2018-07-121-80/+65
| | | | | | | | | | | | | Basically, "AttributeList" loses all list-like mechanisms, ParsedAttributes is switched to use a TinyPtrVector (and a ParsedAttributesView is created to have a non-allocating attributes list). DeclaratorChunk gets the later kind, Declarator/DeclSpec keep ParsedAttributes. Iterators are added to the ParsedAttribute types so that for-loops work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336945 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++17] Disallow lambdas in template parameters (PR33696).Nicolas Lesser2018-07-121-1/+1
| | | | | | | | | | | | | | Summary: This revision disallows lambdas in template parameters, as reported in PR33696. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D37442 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336930 91177308-0d34-0410-b5e6-96231b3b80d8
* Diagnose missing 'template' keywords in more cases.Richard Smith2018-06-261-0/+2
| | | | | | | | | | | | | | | | | | | | We track when we see a name-shaped expression followed by a '<' token and parse the '<' as a comparison. Then: * if we see a token sequence that cannot possibly be an expression but can be a template argument (in particular, a type-id) that follows either a ',' or the '<', diagnose that the '<' was supposed to start a template argument list, and * if we see '>()', diagnose that the '<' was supposed to start a template argument list. This only changes the diagnostic for error cases, and in practice appears to catch the most common cases where a missing 'template' keyword leads to parse errors within a template. Differential Revision: https://reviews.llvm.org/D48571 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335687 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-8/+8
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331834 91177308-0d34-0410-b5e6-96231b3b80d8
* Track the result of evaluating a computed noexcept specification on theRichard Smith2018-05-031-6/+2
| | | | | | | | | | | | | | | FunctionProtoType. We previously re-evaluated the expression each time we wanted to know whether the type is noexcept or not. We now evaluate the expression exactly once. This is not quite "no functional change": it fixes a crasher bug during AST deserialization where we would try to evaluate the noexcept specification in a situation where we have not deserialized sufficient portions of the AST to permit such evaluation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331428 91177308-0d34-0410-b5e6-96231b3b80d8
* Parse A::template B as an identifier rather than as a template-id with noRichard Smith2018-04-271-2/+3
| | | | | | | | | | | template arguments. This fixes some cases where we'd incorrectly accept "A::template B" when B is a kind of template that requires template arguments (in particular, a variable template or a concept). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331013 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert rC330794 and some dependent tiny bug fixes Faisal Vali2018-04-261-2/+2
| | | | | | | | | | | | | | | | | | See Richard's humbling feedback here: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226482.html http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226486.html Wish I'd had the patience to solicit the feedback prior to committing :) Sorry for the noise guys. Thank you Richard for being the steward that clang deserves! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330888 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++2a] [concepts] Add rudimentary parsing support for template concept ↵Faisal Vali2018-04-251-2/+2
| | | | | | | | | | | | | | | declarations This patch is a tweak of changyu's patch: https://reviews.llvm.org/D40381. It differs in that the recognition of the 'concept' token is moved into the machinery that recognizes declaration-specifiers - this allows us to leverage the attribute handling machinery more seamlessly. See the test file to get a sense of the basic parsing that this patch supports. There is much more work to be done before concepts are usable... Thanks Changyu! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330794 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some handling of AST nodes with diagnostics.Richard Trieu2018-03-281-1/+1
| | | | | | | | | | | The diagnostic system for Clang can already handle many AST nodes. Instead of converting them to strings first, just hand the AST node directly to the diagnostic system and let it handle the output. Minor changes in some diagnostic output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328688 91177308-0d34-0410-b5e6-96231b3b80d8
* Sink PrettyDeclStackTrace down to the AST libraryJordan Rose2018-03-231-4/+4
| | | | | | | ...and add some very basic stack trace entries for module building. This would have helped track down rdar://problem/38434694 sooner. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328276 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing direct-init / parameter-declaration-clause disambiguation whenRichard Smith2018-02-021-2/+5
| | | | | | | parsing a trailing-return-type of a (function pointer) variable declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324151 91177308-0d34-0410-b5e6-96231b3b80d8
* Again reverting an attempt to convert the DeclSpec enums into scoped enums.Faisal Vali2018-01-011-15/+11
| | | | | | | | | | | | - reverts r321622, r321625, and r321626. - the use of bit-fields is still resulting in warnings - even though we can use static-asserts to harden the code and ensure the bit-fields are wide enough. The bots still complain of warnings being seen. - to silence the warnings requires specifying the bit-fields with the underlying enum type (as opposed to the enum type itself), which then requires lots of unnecessary static casts of each enumerator within DeclSpec to the underlying-type, which even though could be seen as implementation details, it does hamper readability - and given the additional litterings, makes me question the value of the change. So in short - I give up (for now at least). Sorry about the noise. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321628 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Modernize enums TypeSpecifierWidth, TypeSpecifierSign & ↵Faisal Vali2018-01-011-11/+15
| | | | | | | | | | | | | | TypeSpecifierType into scoped enums with underlying types. - Since these enums are used as bit-fields - for the bit-fields to be interpreted as unsigned, the underlying type must be specified as unsigned. Previous failed attempt - wherein I did not specify an underlying type - was the sum of: https://reviews.llvm.org/rC321614 https://reviews.llvm.org/rC321615 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321622 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r321614 and r321615Faisal Vali2018-01-011-15/+11
| | | | | | | | | - the enum changes to TypeSpecifierType are breaking some tests - and will require a more careful integration. Sorry about rushing these changes - thought I could sneak them in prior to heading out for new years ;) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321616 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Modernize enums TypeSpecifierWidth, TypeSpecifierSign & ↵Faisal Vali2018-01-011-11/+15
| | | | | | | | TypeSpecifierType into scoped enums. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321614 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Modernize enum DeclSpecContext into a scoped enum.Faisal Vali2017-12-311-13/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321590 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Modernize enum 'UnqualifiedId::IdKind' into a scoped enum ↵Faisal Vali2017-12-301-3/+3
| | | | | | UnqualifiedIdKind. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321574 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Modernize enum Declarator::TheContext to a type-safe scoped enum.Faisal Vali2017-12-291-19/+21
| | | | | | | | | | | | Note, we don't do any bitwise manipulations when using them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321546 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that C++17 is official (https://www.iso.org/standard/68564.html), start ↵Aaron Ballman2017-12-041-8/+8
| | | | | | changing the C++1z terminology over to C++17. NFC intended, these are all mechanical changes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319688 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not add a colon chunk to the code completion of class inheritance access ↵Erik Verbruggen2017-10-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | modifiers With enabled CINDEXTEST_CODE_COMPLETE_PATTERNS env option (which enables IncludeCodePatterns in completion options) code completion after colon currently suggests access modifiers with 2 completion chunks which is incorrect. Example: class A : <Cursor>B { } Currently we get 'NotImplemented:{TypedText public}{Colon :} (40)' but the correct line is just 'NotImplemented:{TypedText public} (40)' The fix introduces more specific scope that occurs between ':' and '{' It allows us to determine when we don't need to add ':' as a second chunk to the public/protected/private access modifiers. Patch by Ivan Donchevskii! Differential Revision: https://reviews.llvm.org/D38618 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316436 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -f[no-]double-square-bracket-attributes as new driver options to control ↵Aaron Ballman2017-10-151-15/+20
| | | | | | use of [[]] attributes in all language modes. This is the initial implementation of WG14 N2165, which is a proposal to add [[]] attributes to C2x, but also allows you to enable these attributes in C++98, or disable them in C++11 or later. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315856 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix backwards warning for use of C++17 ↵Richard Smith2017-10-141-3/+4
| | | | | | attributes-on-namespaces-and-enumerators feature. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315784 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++2a] P0683R1: Permit default member initializers for bit-fields.Richard Smith2017-08-281-4/+5
| | | | | | | | This would be trivial, except that our in-memory and serialized representations for FieldDecls assumed that this can't happen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311867 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename cxx1z -> cxx17 across all diagnostic IDs.Richard Smith2017-08-131-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310805 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Implement ODR-like semantics for tag types in C/ObjCBruno Cardoso Lopes2017-07-011-2/+12
| | | | | | | | | | | | | | | | | | | | | | Allow ODR for ObjC/C in the sense that we won't keep more that one definition around (merge them). However, ensure the decl pass the structural compatibility check in C11 6.2.7/1, for that, reuse the structural equivalence checks used by the ASTImporter. Few other considerations: - Create error diagnostics for tag types mismatches and thread them into the structural equivalence checks. - Note that by doing this we only support redefinition between types that are considered "compatible types" by C. This is mixed approach of the suggestions discussed in http://lists.llvm.org/pipermail/cfe-dev/2017-March/053257.html Differential Revision: https://reviews.llvm.org/D31778 rdar://problem/31909368 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306918 91177308-0d34-0410-b5e6-96231b3b80d8
* fix trivial typos, NFCHiroshi Inoue2017-06-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306789 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Fix a crash-on-invalid when a template parameter list has a classAkira Hatanaka2017-06-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | definition or non-reference class type. The crash occurs when there is a template parameter list in a class that is missing the closing angle bracket followed by a definition of a struct. For example: class C0 { public: template<typename T, typename T1 = T // missing closing angle bracket struct S0 {}; C0() : m(new S0<int>) {} S0<int> *m; }; This happens because the parsed struct is added to the scope of the enclosing class without having its access specifier set, which results in an assertion failure in SemaAccess.cpp later. This commit fixes the crash by adding the parsed struct to the enclosing file scope and marking structs as invalid if they are defined in template parameter lists. rdar://problem/31783961 rdar://problem/19570630 Differential Revision: https://reviews.llvm.org/D33606 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306317 91177308-0d34-0410-b5e6-96231b3b80d8
* PR33318: Add missing full-expression checking to static_assert expression.Richard Smith2017-06-061-1/+3
| | | | | | | | This fixes missing lambda-captures for variables referenced only inside a static_assert (!), among other things. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304760 91177308-0d34-0410-b5e6-96231b3b80d8
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-011-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304473 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the location of "missing ';'" suggestions after annotation tokens.Richard Smith2017-05-181-29/+32
| | | | | | | | | | | We were incorrectly setting PrevTokLocation to the first token in the annotation token instead of the last when consuming it. To fix this without adding a complex switch to the hot path through ConsumeToken, we now have a ConsumeAnnotationToken function for consuming annotation tokens in addition to the other Consume*Token special case functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303372 91177308-0d34-0410-b5e6-96231b3b80d8