diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-06 23:52:28 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-06 23:52:28 +0000 |
| commit | 122f88d481971b68d05ba12395c3b73ab4b31ab3 (patch) | |
| tree | c59ee8196c104634ee39555cc8b9d97ee5d75b5c /clang/include | |
| parent | 2187bb8a89cdbe529ee222bf56d1b7415337cb20 (diff) | |
| download | bcm5719-llvm-122f88d481971b68d05ba12395c3b73ab4b31ab3.tar.gz bcm5719-llvm-122f88d481971b68d05ba12395c3b73ab4b31ab3.zip | |
[c++17] P0135R1: Guaranteed copy elision.
When an object of class type is initialized from a prvalue of the same type
(ignoring cv qualifications), use the prvalue to initialize the object directly
instead of inserting a redundant elidable call to a copy constructor.
llvm-svn: 288866
Diffstat (limited to 'clang/include')
| -rw-r--r-- | clang/include/clang/AST/Expr.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h index 763a0679562..895ac2b60ca 100644 --- a/clang/include/clang/AST/Expr.h +++ b/clang/include/clang/AST/Expr.h @@ -3786,7 +3786,7 @@ public: /// \brief Build an empty initializer list. explicit InitListExpr(EmptyShell Empty) - : Expr(InitListExprClass, Empty) { } + : Expr(InitListExprClass, Empty), AltForm(nullptr, true) { } unsigned getNumInits() const { return InitExprs.size(); } @@ -3894,6 +3894,11 @@ public: // literal or an @encode? bool isStringLiteralInit() const; + /// Is this a transparent initializer list (that is, an InitListExpr that is + /// purely syntactic, and whose semantics are that of the sole contained + /// initializer)? + bool isTransparent() const; + SourceLocation getLBraceLoc() const { return LBraceLoc; } void setLBraceLoc(SourceLocation Loc) { LBraceLoc = Loc; } SourceLocation getRBraceLoc() const { return RBraceLoc; } |

