summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx1z-decomposition.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add -std=c++20 flag, replace C++2a with C++20 throughout the ClangRichard Smith2020-02-191-2/+2
| | | | | | | | | | | | | user interface and documentation, and update __cplusplus for C++20. WG21 considers the C++20 standard to be finished (even though it still has some more steps to pass through in the ISO process). The old flag names are accepted for compatibility, as usual, and we still have lots of references to C++2a in comments and identifiers; those can be cleaned up separately. (cherry picked from commit 24ad121582454e625bdad125c90d9ac0dae948c8)
* Permit static local structured bindings to be named from arbitrary scopes ↵Richard Smith2019-05-251-2/+7
| | | | | | inside their declaring scope. llvm-svn: 361686
* Part of P1091R3: permit structured bindings to be declared 'static' andRichard Smith2019-05-221-1/+1
| | | | | | 'thread_local' in C++20. llvm-svn: 361424
* [SemaCXX] Fix ICE with structure bindings to members of templateNicolas Lesser2019-01-271-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Trying to use structure binding with a structure that doesn't implement std::tuple_size, should unpack the data members. When the struct is a template though, clang might hit an assertion (if the type has not been completed before), because CXXRecordDecl::DefinitionData is nullptr. This commit fixes the problem by completing the type while trying to decompose the structured binding. The ICE happens in real world code, for example, when trying to iterate a protobuf generated map with a range-based for loop and structure bindings (because google::protobuf::MapPair is a template and doesn't support std::tuple_size). Reported-by: nicholas.sun@nlsun.com Patch by Daniele Di Proietto Reviewers: #clang, rsmith Reviewed By: #clang, rsmith Subscribers: cpplearner, Rakete1111, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D56974 llvm-svn: 352323
* PR37352: mangle numbering for decomposition declarations.Richard Smith2018-05-071-0/+5
| | | | | | | | | | In order to match our mangling scheme, use a different set of numbers for decomposition declarations, and consider all binding names when forming the numbering. This does not yet affect any mangled names we produce, because local decomposition declarations can't yet have linkage, but a C++ standard proposal to change that is currently being processed. llvm-svn: 331692
* [Sema][C++1z] Ensure binding in dependent range for have non-null typeErik Pilkington2017-06-121-0/+6
| | | | | | | | Fixes PR32172 Differential revision: https://reviews.llvm.org/D34096 llvm-svn: 305195
* Bail out if we try to build a DeclRefExpr naming an invalid declaration.Richard Smith2017-01-041-0/+5
| | | | | | | | | | | Most code paths would already bail out in this case, but certain paths, particularly overload resolution and typo correction, would not. Carrying on with an invalid declaration could in some cases result in crashes due to downstream code relying on declaration invariants that are not necessarily met for invalid declarations, and in other cases just resulted in undesirable follow-on diagnostics. llvm-svn: 291030
* When a DecompositionDecl is marked invalid, also set the child BindingDecl's toRichard Trieu2016-11-111-0/+12
| | | | | | invalid. llvm-svn: 286630
* [c++1z] Fix assertion failure when using the wrong number of bindings for aRichard Smith2016-10-201-0/+6
| | | | | | struct with unnamed bitfields. llvm-svn: 284761
* Disable lambda-capture of decomposition declaration bindings for now, until CWGRichard Smith2016-08-151-0/+10
| | | | | | agrees on how they're supposed to work. llvm-svn: 278648
* P0217R3: code generation support for decomposition declarations.Richard Smith2016-08-151-1/+0
| | | | llvm-svn: 278642
* P0217R3: serialization/deserialization support for c++17 decomposition ↵Richard Smith2016-08-121-1/+0
| | | | | | declarations. llvm-svn: 278460
* P0217R3: template instantiation support for decomposition declarations.Richard Smith2016-08-121-1/+0
| | | | llvm-svn: 278458
* P0217R3: Constant expression evaluation for decomposition declarations.Richard Smith2016-08-121-3/+19
| | | | llvm-svn: 278447
* P0217R3: Perform semantic checks and initialization for the bindings in aRichard Smith2016-08-111-1/+17
| | | | | | | decomposition declaration for arrays, aggregate-like structs, tuple-like types, and (as an extension) for complex and vector types. llvm-svn: 278435
* P0217R3: Parsing support and framework for AST representation of C++1zRichard Smith2016-07-221-0/+11
decomposition declarations. There are a couple of things in the wording that seem strange here: decomposition declarations are permitted at namespace scope (which we partially support here) and they are permitted as the declaration in a template (which we reject). llvm-svn: 276492
OpenPOWER on IntegriCloud