summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser
Commit message (Collapse)AuthorAgeFilesLines
...
* [Parser] Support alternative operator token keyword args in Objective-C++Erik Pilkington2018-08-211-0/+41
| | | | | | | | rdar://30741878 Differential revision: https://reviews.llvm.org/D50527 llvm-svn: 340301
* [ObjC] Error out when using forward-declared protocol in a @protocolAlex Lorenz2018-08-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | expression Clang emits invalid protocol metadata when a @protocol expression is used with a forward-declared protocol. The protocol metadata is missing protocol conformance list of the protocol since we don't have access to the definition of it in the compiled translation unit. The linker then might end up picking the invalid metadata when linking which will lead to incorrect runtime protocol conformance checks. This commit makes sure that Clang fails to compile code that uses a @protocol expression with a forward-declared protocol. This ensures that Clang does not emit invalid protocol metadata. I added an extra assert in CodeGen to ensure that this kind of issue won't happen in other places. rdar://32787811 Differential Revision: https://reviews.llvm.org/D49462 llvm-svn: 340102
* Append new attributes to the end of an AttributeList.Michael Kruse2018-08-034-51/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 338800
* [UnrollAndJam] Add unroll_and_jam pragma handlingDavid Green2018-08-011-0/+78
| | | | | | | | | | | | | | This adds support for the unroll_and_jam pragma, to go with the recently added unroll and jam pass. The name of the pragma is the same as is used in the Intel compiler, and most of the code works the same as for unroll. #pragma clang loop unroll_and_jam has been separated into a different patch. This part adds #pragma unroll_and_jam with an optional count, and #pragma no_unroll_and_jam to disable the transform. Differential Revision: https://reviews.llvm.org/D47267 llvm-svn: 338566
* Parse a possible trailing postfix expression suffix after a fold expressionNicolas Lesser2018-07-271-0/+26
| | | | | | | | | | | | | | | | | Summary: This patch allows the parsing of a postfix expression involving a fold expression, which is legal as a fold-expression is a primary-expression. See also https://llvm.org/pr38282 Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49848 llvm-svn: 338170
* Refactor checking of switch conditions and case values.Richard Smith2018-07-261-3/+5
| | | | | | | | | | | | | | | | | | | Check each case value in turn while parsing it, performing the conversion to the switch type within the context of the expression itself. This will become necessary in order to properly handle cleanups for temporaries created as part of the case label (in an upcoming patch). For now it's just good hygiene. This necessitates moving the checking for the switch condition itself to earlier, so that the destination type is available when checking the case labels. As a nice side-effect, we get slightly improved diagnostic quality and error recovery by separating the case expression checking from the case statement checking and from tracking whether there are discarded case labels. llvm-svn: 338056
* [Parse] Make -Wgcc-compat complain about for loop inits in C89George Burgess IV2018-06-281-0/+15
| | | | | | | | | | While clang allows declarations in for loop init statements in c89 and gnu89, gcc does not. So, we should probably warn if users care about gcc compatibility. Differential Revision: https://reviews.llvm.org/D47840 llvm-svn: 335927
* Revert "Append new attributes to the end of an AttributeList."Michael Kruse2018-06-253-48/+49
| | | | | | | This reverts commit r335084 as requested by David Jones and Eric Christopher because of differences of emitted warnings. llvm-svn: 335516
* Append new attributes to the end of an AttributeList.Michael Kruse2018-06-193-49/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... 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, and therefore printed in the wrong order by -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 effects, especially for 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 attribute's order was changed instead. It also causes some 'previous occurrence here' hints to be textually after the main marker. This typically happens when attributes are merged, but are incompatible. 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 reversed. 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, which often is on the same line. Differential Revision: https://reviews.llvm.org/D48100 llvm-svn: 335084
* Reapply "[Parse] Use CapturedStmt for @finally on MSVC"Shoaib Meenai2018-06-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reapplies r334224 and adds explicit triples to some tests to fix them on Windows (where otherwise they would have run with the default windows-msvc triple, which I'm changing the behavior for). Original commit message: The body of a `@finally` needs to be executed on both exceptional and non-exceptional paths. On landingpad platforms, this is straightforward: the `@finally` body is emitted as a normal (non-exceptional) cleanup, and then a catch-all is emitted which branches to that cleanup (the cleanup has code to conditionally re-throw based on a flag which is set by the catch-all). Unfortunately, we can't use the same approach for MSVC exceptions, where the catch-all will be emitted as a catchpad. We can't just branch to the cleanup from within the catchpad, since we can only exit it via a catchret, at which point the exception is destroyed and we can't rethrow. We could potentially emit the finally body inside the catchpad and have the normal cleanup path somehow branch into it, but that would require some new IR construct that could branch into a catchpad. Instead, after discussing it with Reid Kleckner, we decided that frontend outlining was the best approach, similar to how SEH `__finally` works today. We decided to use CapturedStmt (which was also suggested by Reid) rather than CaptureFinder (which is what `__finally` uses) since the latter doesn't handle a lot of cases we care about, e.g. self accesses, property accesses, block captures, etc. Extending CaptureFinder to handle those additional cases proved unwieldy, whereas CapturedStmt already took care of all of those. In theory `__finally` could also be moved over to CapturedStmt, which would remove some existing limitations (e.g. the inability to capture this), although CaptureFinder would still be needed for SEH filters. The one case supported by `@finally` but not CapturedStmt (or CaptureFinder for that matter) is arbitrary control flow out of the `@finally`, e.g. having a return statement inside a `@finally`. We can add that support as a follow-up, but in practice we've found it to be used very rarely anyway. Differential Revision: https://reviews.llvm.org/D47564 llvm-svn: 334251
* Improve diagonstic for braced-init-list as operand to ?: expression.Richard Smith2018-05-241-1/+3
| | | | llvm-svn: 333234
* [libclang] Allow skipping function bodies in preamble onlyIvan Donchevskii2018-05-172-1/+15
| | | | | | | | | | | | | | | | | | | Second attempt. Fix line endings and warning. As an addition to CXTranslationUnit_SkipFunctionBodies, provide the new option CXTranslationUnit_LimitSkipFunctionBodiesToPreamble, which constraints the skipping of functions bodies to the preamble only. Function bodies in the main file are not affected if this option is set. Skipping function bodies only in the preamble is what clangd already does and the introduced flag implements it for libclang clients. Patch by Nikolai Kosjar. Differential Revision: https://reviews.llvm.org/D45815 llvm-svn: 332587
* Revert https://reviews.llvm.org/D46050 and https://reviews.llvm.org/D45815Ivan Donchevskii2018-05-172-27/+13
| | | | | | | Windows line endings. Requires proper resubmission. llvm-svn: 332585
* [libclang] Allow skipping function bodies in preamble onlyIvan Donchevskii2018-05-172-13/+27
| | | | | | | | | | | | | | | | | As an addition to CXTranslationUnit_SkipFunctionBodies, provide the new option CXTranslationUnit_LimitSkipFunctionBodiesToPreamble, which constraints the skipping of functions bodies to the preamble only. Function bodies in the main file are not affected if this option is set. Skipping function bodies only in the preamble is what clangd already does and the introduced flag implements it for libclang clients. Patch by Nikolai Kosjar. Differential Revision: https://reviews.llvm.org/D45815 llvm-svn: 332578
* [OpenCL] Restrict various keywords in OpenCL C++ modeSven van Haastregt2018-05-093-10/+60
| | | | | | | | | | | | | | | | | | | | | | | Restrict the following keywords in the OpenCL C++ language mode, according to Sections 2.2 & 2.9 of the OpenCL C++ 1.0 Specification. - dynamic_cast - typeid - register (already restricted in OpenCL C, update the diagnostic) - thread_local - exceptions (try/catch/throw) - access qualifiers read_only, write_only, read_write Support the `__global`, `__local`, `__constant`, `__private`, and `__generic` keywords in OpenCL C++. Leave the unprefixed address space qualifiers such as global available, i.e., do not mark them as reserved keywords in OpenCL C++. libclcxx provides explicit address space pointer classes such as `global_ptr` and `global<T>` that are implemented using the `__`-prefixed qualifiers. Differential Revision: https://reviews.llvm.org/D46022 llvm-svn: 331874
* PR37189 Fix incorrect end source location and spelling for a split '>>' token.Richard Smith2018-04-301-3/+6
| | | | | | | | | | | | | | | | | | When a '>>' token is split into two '>' tokens (in C++11 onwards), or (as an extension) when we do the same for other tokens starting with a '>', we can't just use a location pointing to the first '>' as the location of the split token, because that would result in our miscomputing the length and spelling for the token. As a consequence, for example, a refactoring replacing 'A<X>' with something else would sometimes replace one character too many, and similarly diagnostics highlighting a template-id source range would highlight one character too many. Fix this by creating an expansion range covering the first character of the '>>' token, whose spelling is '>'. For this to work, we generalize the expansion range of a macro FileID to be either a token range (the common case) or a character range (used in this new case). llvm-svn: 331155
* 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). llvm-svn: 331013
* Revert rC330794 and some dependent tiny bug fixes Faisal Vali2018-04-262-83/+7
| | | | | | | | | | | | | | 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! llvm-svn: 330888
* [c++2a] [concepts] Add rudimentary parsing support for template concept ↵Faisal Vali2018-04-252-7/+83
| | | | | | | | | | | | | | 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! llvm-svn: 330794
* [OpenCL] Reject virtual functions for OpenCL C++Sven van Haastregt2018-04-231-0/+45
| | | | | | Differential Revision: https://reviews.llvm.org/D45873 llvm-svn: 330579
* [Parser] Fix assertion-on-invalid for unexpected typename.Volodymyr Sapsai2018-04-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | In `ParseDeclarationSpecifiers` for the code class A typename A; we were able to annotate token `kw_typename` because it refers to existing type. But later during processing token `annot_typename` we failed to `SetTypeSpecType` and exited switch statement leaving annotation token unconsumed. The code after the switch statement failed because it didn't expect a special token. The fix is not to assume that switch statement consumes all special tokens and consume any token, not just non-special. rdar://problem/37099386 Reviewers: rsmith, arphaman Reviewed By: rsmith Subscribers: jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D44449 llvm-svn: 329735
* Fix typos in clangAlexander Kornienko2018-04-062-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 llvm-svn: 329399
* [C++17] Fix class template argument deduction for default constructors ↵Zhihao Yuan2018-03-241-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | without an initializer Summary: As the title says, this makes following code compile: ``` template<typename> struct Foo {}; Foo() -> Foo<void>; Foo f; // ok ``` Thanks Nicolas Lesser for coining the fix. Reviewers: rsmith, lichray Reviewed By: rsmith, lichray Subscribers: lichray, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D38216 llvm-svn: 328409
* Fix codegen for structured binding binding in conditionsZhihao Yuan2018-03-171-4/+30
| | | | | | | | | | | | | | | | | | | | | Summary: The codegen for conditions assumes that a normal variable declaration is used in a condition, but this is not the case when a structured binding is used. This fixes [PR36747](http://llvm.org/pr36747). Thanks Nicolas Lesser for contributing the patch. Reviewers: lichray, rsmith Reviewed By: lichray Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D44534 llvm-svn: 327780
* [Parser] (C++) Make -Wextra-semi slightly more usefulRoman Lebedev2018-03-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Let's suppose the `-Weverything` is passed. Given code like ``` void F() {} ; ``` If the code is compiled with `-std=c++03`, it would diagnose that extra sema: ``` <source>:2:1: warning: extra ';' outside of a function is a C++11 extension [-Wc++11-extra-semi] ; ^~ ``` If the code is compiled with `-std=c++11`, it also would diagnose that extra sema: ``` <source>:2:1: warning: extra ';' outside of a function is incompatible with C++98 [-Wc++98-compat-pedantic] ; ^~ ``` But, let's suppose the C++11 or higher is used, and the used does not care about `-Wc++98-compat-pedantic`, so he disables that diagnostic. And that silences the complaint about extra `;` too. And there is no way to re-enable that particular diagnostic, passing `-Wextra-semi` does nothing... Now, there is also a related `no newline at end of file` diagnostic, which is also emitted by `-Wc++98-compat-pedantic` ``` <source>:2:2: warning: C++98 requires newline at end of file [-Wc++98-compat-pedantic] ; ^ ``` But unlike the previous case, if `-Wno-c++98-compat-pedantic` is passed, that diagnostic stays displayed: ``` <source>:2:2: warning: no newline at end of file [-Wnewline-eof] ; ^ ``` This diff refactors the code so `-Wc++98-compat-extra-semi` can be re-enabled, after the `-Wc++98-compat-pedantic` was disabled. This seems ugly, but there does not seem to be any saner way. Testing: `$ ninja check-clang` Reviewers: rsmith, rtrieu, aaron.ballman Reviewed By: aaron.ballman Subscribers: jordan_rose, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D43162 llvm-svn: 327558
* [MS] Accept __unaligned as a qualifier on member function pointersReid Kleckner2018-03-071-0/+7
| | | | | | | | | | We need to treat __unaligned like the other 'cvr' qualifiers when it appears at the end of a function prototype. We weren't doing that in some tentative parsing. Fixes PR36638. llvm-svn: 326962
* Fix a couple of cases where we would fail to correctly parse deduced class ↵Richard Smith2018-02-281-1/+39
| | | | | | | | | | | | | | | | template specialization types. Specifically, we would not properly parse these types within template arguments (for non-type template parameters), and in tentative parses. Fixing both of these essentially requires that we parse deduced template specialization types as types in all contexts, even in template argument lists -- in particular, tentative parsing may look ahead and annotate a deduced template specialization type before we figure out that we're actually supposed to treat the tokens as a template-name. We deal with this by simply permitting deduced template specialization types when parsing template arguments, and converting them to template template arguments. llvm-svn: 326299
* Allow the NS, CF, and ObjC attributes to be used with ↵Aaron Ballman2018-02-121-0/+28
| | | | | | -fdouble-square-bracket-attributes. The syntactic locations for such attributes on ObjC constructs have been specifically chosen to follow the GNU attribute syntactic locations. llvm-svn: 324890
* Add missing direct-init / parameter-declaration-clause disambiguation whenRichard Smith2018-02-022-1/+5
| | | | | | parsing a trailing-return-type of a (function pointer) variable declaration. llvm-svn: 324151
* Factor out comparison handling for arithmetic types.Richard Smith2018-01-081-1/+1
| | | | | | | | | | This is not quite NFC: we don't perform the usual arithmetic conversions unless we have an operand of arithmetic or enumeration type any more. This matches the standard rule, but actually has no effect other than to marginally improve our diagnostics for the non-arithmetic, non-enumeration cases (by not performing integral promotions on one operand if the other is a pointer). llvm-svn: 322024
* Add a fixit for attributes incorrectly placed prior to 'struct/class/enum' ↵Faisal Vali2017-12-253-5/+12
| | | | | | | | | | | | | keyword. Suggest moving the following erroneous attrib list (based on location) [[]] struct X; to struct [[]] X; Additionally, added a fixme for the current implementation that diagnoses misplaced attributes to consider using the newly introduced diagnostic (that I think is more user-friendly). llvm-svn: 321449
* Suppress "redundant parens" warning for "A (::B())".Richard Smith2017-12-211-0/+16
| | | | | | | | This is a slightly odd construct (it's more common to see "A (::B)()") but can happen in friend declarations, and the parens are not redundant as they prevent the :: binding to the left. llvm-svn: 321318
* Re-commit r321223, which adds a printing policy to the ASTDumper.Aaron Ballman2017-12-211-21/+21
| | | | | | | | This allows you to dump C++ code that spells bool instead of _Bool, leaves off the elaborated type specifiers when printing struct or class names, and other C-isms. Fixes the -Wreorder issue and fixes the ast-dump-color.cpp test. llvm-svn: 321310
* Don't produce redundant parentheses warning for "A (::B);" and the like.Richard Smith2017-12-211-4/+23
| | | | | | | The parentheses here are not redundant as they affect the binding of the '::' token. llvm-svn: 321304
* Reverting r321223 and its follow-up commit because of failing bots due to ↵Aaron Ballman2017-12-201-21/+21
| | | | | | Misc/ast-dump-color.cpp. llvm-svn: 321229
* Add a printing policy to the ASTDumper.Aaron Ballman2017-12-201-21/+21
| | | | | | This allows you to dump C++ code that spells bool instead of _Bool, leaves off the elaborated type specifiers when printing struct or class names, and other C-isms. llvm-svn: 321223
* [c++20] P0515R3: Parsing support and basic AST construction for operator <=>.Richard Smith2017-12-141-0/+18
| | | | | | | | | | | | | | | Adding the new enumerator forced a bunch more changes into this patch than I would have liked. The -Wtautological-compare warning was extended to properly check the new comparison operator, clang-format needed updating because it uses precedence levels as weights for determining where to break lines (and several operators increased their precedence levels with this change), thread-safety analysis needed changes to build its own IL properly for the new operator. All "real" semantic checking for this operator has been deferred to a future patch. For now, we use the relational comparison rules and arbitrarily give the builtin form of the operator a return type of 'void'. llvm-svn: 320707
* Switch to gnu++14 as the default dialect.Tim Northover2017-12-091-1/+1
| | | | | | This is C++14 with conforming GNU extensions. llvm-svn: 320250
* Allow conditions to be decomposed with structured bindingsZhihao Yuan2017-12-072-7/+69
| | | | | | | | | | | | | | | | | | | | | Summary: This feature was discussed but not yet proposed. It allows a structured binding to appear as a //condition// if (auto [ok, val] = f(...)) So the user can save an extra //condition// if the statement can test the value to-be-decomposed instead. Formally, it makes the value of the underlying object of the structured binding declaration also the value of a //condition// that is an initialized declaration. Considering its logicality which is entirely evident from its trivial implementation, I think it might be acceptable to land it as an extension for now before I write the paper. Reviewers: rsmith, faisalv, aaron.ballman Reviewed By: rsmith Subscribers: aaron.ballman, cfe-commits Differential Revision: https://reviews.llvm.org/D39284 llvm-svn: 320011
* Remove old concepts parsing codeHubert Tong2017-12-071-25/+4
| | | | | | | | | | | | | | | | | | Summary: This is so we can implement concepts per P0734R0. Relevant failing test cases are disabled. Reviewers: hubert.reinterpretcast, rsmith, saar.raz, nwilson Reviewed By: saar.raz Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40380 Patch by Changyu Li! llvm-svn: 319992
* Determine the attribute subject for diagnostics based on declarative ↵Aaron Ballman2017-11-263-4/+4
| | | | | | | | | | information in DeclNodes.td. This greatly reduces the number of enumerated values used for more complex diagnostics; these are now only required when the "attribute only applies to" diagnostic needs to be generated manually as part of semantic processing. This also clarifies some terminology used by the diagnostic (methods -> Objective-C methods, fields -> non-static data members, etc). Many of the tests needed to be updated in multiple places for the diagnostic wording tweaks. The first instance of the diagnostic for that attribute is fully specified and subsequent instances cut off the complete list (to make it easier if additional subjects are added in the future for the attribute). llvm-svn: 319002
* [Parser] Fix TryParseLambdaIntroducer() error handlingJan Korous2017-11-061-0/+10
| | | | | | | | rdar://35066196 Differential Revision: https://reviews.llvm.org/D39419 llvm-svn: 317493
* Fix usage of right shift operator in fold expressionsRichard Smith2017-10-311-0/+17
| | | | | | | | The right shift operator was not seen as a valid operator in a fold expression, which is PR32563. Patch by Nicolas Lesser ("Blitz Rakete")! llvm-svn: 317032
* Make __builtin_types_compatible_p more like GCC'sGeorge Burgess IV2017-10-161-0/+17
| | | | | | | | | | | GCC ignore qualifiers on array types. Since we seem to have this function primarily for GCC compatibility, we should try to match that behavior. This also adds a few more test-cases __builtin_types_compatible_p, which were inspired by GCC's documentation on the builtin. llvm-svn: 315951
* Add -f[no-]double-square-bracket-attributes as new driver options to control ↵Aaron Ballman2017-10-152-0/+143
| | | | | | 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. llvm-svn: 315856
* Fix backwards warning for use of C++17 ↵Richard Smith2017-10-141-2/+2
| | | | | | attributes-on-namespaces-and-enumerators feature. llvm-svn: 315784
* A '<' with a trigraph '#' is not a valid editor placeholderAlex Lorenz2017-10-111-0/+4
| | | | | | | | | Credit to OSS-Fuzz for discovery: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3137#c5 rdar://34923985 llvm-svn: 315398
* Add a "vexing parse" warning for ambiguity between a variable declaration and aRichard Smith2017-09-292-2/+3
| | | | | | | | | | | | | | function-style cast. This fires for cases such as T(x); ... where 'x' was previously declared and T is a type. This construct declares a variable named 'x' rather than the (probably expected) interpretation of a function-style cast of 'x' to T. llvm-svn: 314570
* Properly parse a postfix expression following a Boolean literal. Fixes PR34273.Aaron Ballman2017-09-281-1/+8
| | | | | | Patch by Nicolas Lesser. llvm-svn: 314463
* [c++2a] P0683R1: Permit default member initializers for bit-fields.Richard Smith2017-08-281-0/+22
| | | | | | | This would be trivial, except that our in-memory and serialized representations for FieldDecls assumed that this can't happen. llvm-svn: 311867
OpenPOWER on IntegriCloud