diff options
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/AST/ExprCXX.h | 27 | ||||
-rw-r--r-- | include/clang/AST/RecursiveASTVisitor.h | 2 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 3 | ||||
-rw-r--r-- | include/clang/Basic/StmtNodes.td | 2 | ||||
-rw-r--r-- | include/clang/Frontend/PCHBitCodes.h | 2 |
5 files changed, 19 insertions, 17 deletions
diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h index aacb000860..6da32bacd3 100644 --- a/include/clang/AST/ExprCXX.h +++ b/include/clang/AST/ExprCXX.h @@ -822,8 +822,12 @@ public: /// /// This expression type represents a C++ "functional" cast /// (C++[expr.type.conv]) with N != 1 arguments that invokes a -/// constructor to build a temporary object. With N == 1 arguments the -/// functional cast expression will be represented by CXXFunctionalCastExpr. +/// constructor to build a temporary object. If N == 0 but no +/// constructor will be called (because the functional cast is +/// performing a value-initialized an object whose class type has no +/// user-declared constructors), CXXZeroInitValueExpr will represent +/// the functional cast. Finally, with N == 1 arguments the functional +/// cast expression will be represented by CXXFunctionalCastExpr. /// Example: /// @code /// struct X { X(int, float); } @@ -857,21 +861,22 @@ public: static bool classof(const CXXTemporaryObjectExpr *) { return true; } }; -/// CXXScalarValueInitExpr - [C++ 5.2.3p2] +/// CXXZeroInitValueExpr - [C++ 5.2.3p2] /// Expression "T()" which creates a value-initialized rvalue of type -/// T, which is a non-class type. +/// T, which is either a non-class type or a class type without any +/// user-defined constructors. /// -class CXXScalarValueInitExpr : public Expr { +class CXXZeroInitValueExpr : public Expr { SourceLocation TyBeginLoc; SourceLocation RParenLoc; public: - CXXScalarValueInitExpr(QualType ty, SourceLocation tyBeginLoc, + CXXZeroInitValueExpr(QualType ty, SourceLocation tyBeginLoc, SourceLocation rParenLoc ) : - Expr(CXXScalarValueInitExprClass, ty, false, false), + Expr(CXXZeroInitValueExprClass, ty, false, false), TyBeginLoc(tyBeginLoc), RParenLoc(rParenLoc) {} - explicit CXXScalarValueInitExpr(EmptyShell Shell) - : Expr(CXXScalarValueInitExprClass, Shell) { } + explicit CXXZeroInitValueExpr(EmptyShell Shell) + : Expr(CXXZeroInitValueExprClass, Shell) { } SourceLocation getTypeBeginLoc() const { return TyBeginLoc; } SourceLocation getRParenLoc() const { return RParenLoc; } @@ -890,9 +895,9 @@ public: } static bool classof(const Stmt *T) { - return T->getStmtClass() == CXXScalarValueInitExprClass; + return T->getStmtClass() == CXXZeroInitValueExprClass; } - static bool classof(const CXXScalarValueInitExpr *) { return true; } + static bool classof(const CXXZeroInitValueExpr *) { return true; } // Iterators virtual child_iterator child_begin(); diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index f734c9af52..bf88aa084b 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -1545,7 +1545,7 @@ bool RecursiveASTVisitor<Derived>::TraverseInitListExpr(InitListExpr *S) { return true; } -DEF_TRAVERSE_STMT(CXXScalarValueInitExpr, { +DEF_TRAVERSE_STMT(CXXZeroInitValueExpr, { // This is called for code like 'return MyClass()' where MyClass // has no user-defined constructor. It's also called for 'return // int()'. We recurse on type MyClass/int. diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 0883eab003..f88a0ae664 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -509,9 +509,6 @@ def err_access_dtor_vbase : def err_access_dtor_temp : Error<"temporary of type %0 has %select{private|protected}1 destructor">, NoSFINAE; -def err_access_dtor_exception : - Error<"exception object of type %0 has %select{private|protected}1 " - "destructor">, NoSFINAE; def err_access_dtor_field : Error<"field of type %1 has %select{private|protected}2 destructor">, NoSFINAE; diff --git a/include/clang/Basic/StmtNodes.td b/include/clang/Basic/StmtNodes.td index a2f69730a0..bfdac746ce 100644 --- a/include/clang/Basic/StmtNodes.td +++ b/include/clang/Basic/StmtNodes.td @@ -95,7 +95,7 @@ def CXXNullPtrLiteralExpr : DStmt<Expr>; def CXXThisExpr : DStmt<Expr>; def CXXThrowExpr : DStmt<Expr>; def CXXDefaultArgExpr : DStmt<Expr>; -def CXXScalarValueInitExpr : DStmt<Expr>; +def CXXZeroInitValueExpr : DStmt<Expr>; def CXXNewExpr : DStmt<Expr>; def CXXDeleteExpr : DStmt<Expr>; def CXXPseudoDestructorExpr : DStmt<Expr>; diff --git a/include/clang/Frontend/PCHBitCodes.h b/include/clang/Frontend/PCHBitCodes.h index 4da96044c5..f3fb053f3c 100644 --- a/include/clang/Frontend/PCHBitCodes.h +++ b/include/clang/Frontend/PCHBitCodes.h @@ -778,7 +778,7 @@ namespace clang { EXPR_CXX_DEFAULT_ARG, // CXXDefaultArgExpr EXPR_CXX_BIND_TEMPORARY, // CXXBindTemporaryExpr // - EXPR_CXX_SCALAR_VALUE_INIT, // CXXScalarValueInitExpr + EXPR_CXX_ZERO_INIT_VALUE, // CXXZeroInitValueExpr EXPR_CXX_NEW, // CXXNewExpr EXPR_CXX_DELETE, // CXXDeleteExpr EXPR_CXX_PSEUDO_DESTRUCTOR, // CXXPseudoDestructorExpr |