diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
commit | 5e20cdd81c44a443562a09007668ffdf76c455af (patch) | |
tree | dbbd4047878da71c1a706e26ce05b4e7791b14cc /include/clang/AST/ExprCXX.h | |
parent | d5f23b0b7528b5c3caed1ba14f897cc4aaa9e3c3 (diff) | |
download | src-434ab66796bbe752e77357049917ed2c57e74a5d.tar.gz src-434ab66796bbe752e77357049917ed2c57e74a5d.zip |
Vendor import of clang trunk r238337:vendor/clang/clang-trunk-r238337
Diffstat (limited to 'include/clang/AST/ExprCXX.h')
-rw-r--r-- | include/clang/AST/ExprCXX.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h index 176817823ea9..1dbf5743c124 100644 --- a/include/clang/AST/ExprCXX.h +++ b/include/clang/AST/ExprCXX.h @@ -86,6 +86,13 @@ public: /// of the right bracket. SourceLocation getOperatorLoc() const { return getRParenLoc(); } + SourceLocation getExprLoc() const LLVM_READONLY { + return (Operator < OO_Plus || Operator >= OO_Arrow || + Operator == OO_PlusPlus || Operator == OO_MinusMinus) + ? getLocStart() + : getOperatorLoc(); + } + SourceLocation getLocStart() const LLVM_READONLY { return Range.getBegin(); } SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); } SourceRange getSourceRange() const { return Range; } @@ -1127,7 +1134,7 @@ public: ConstructionKind ConstructKind, SourceRange ParenOrBraceRange); - CXXConstructorDecl* getConstructor() const { return Constructor; } + CXXConstructorDecl *getConstructor() const { return Constructor; } void setConstructor(CXXConstructorDecl *C) { Constructor = C; } SourceLocation getLocation() const { return Loc; } @@ -1404,14 +1411,13 @@ class LambdaExpr : public Expr { unsigned *getArrayIndexStarts() const { return reinterpret_cast<unsigned *>(getStoredStmts() + NumCaptures + 1); } - + /// \brief Retrieve the complete set of array-index variables. VarDecl **getArrayIndexVars() const { - unsigned ArrayIndexSize = - llvm::RoundUpToAlignment(sizeof(unsigned) * (NumCaptures + 1), - llvm::alignOf<VarDecl*>()); + unsigned ArrayIndexSize = llvm::RoundUpToAlignment( + sizeof(unsigned) * (NumCaptures + 1), llvm::alignOf<VarDecl *>()); return reinterpret_cast<VarDecl **>( - reinterpret_cast<char*>(getArrayIndexStarts()) + ArrayIndexSize); + reinterpret_cast<char *>(getArrayIndexStarts()) + ArrayIndexSize); } public: @@ -1446,6 +1452,9 @@ public: return CaptureDefaultLoc; } + /// \brief Determine whether one of this lambda's captures is an init-capture. + bool isInitCapture(const LambdaCapture *Capture) const; + /// \brief An iterator that walks over the captures of the lambda, /// both implicit and explicit. typedef const Capture *capture_iterator; @@ -1686,6 +1695,10 @@ public: /// not be done, the deallocation function shall not be called, /// and the value of the new-expression shall be null. /// + /// C++ DR1748: + /// If the allocation function is a reserved placement allocation + /// function that returns null, the behavior is undefined. + /// /// An allocation function is not allowed to return null unless it /// has a non-throwing exception-specification. The '03 rule is /// identical except that the definition of a non-throwing |