aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-07-08 06:14:04 +0000
committerDouglas Gregor <dgregor@apple.com>2010-07-08 06:14:04 +0000
commited8abf18329df67b0abcbb3a10458bd8c1d2a595 (patch)
tree9f6a81434fb6001b6bd5538874e7fd94d0c8eed2 /include/clang
parent29457ff5cdfa86105e47e133010087979c866388 (diff)
Reinstate the fix for PR7556. A silly use of isTrivial() was
suppressing copies of objects with trivial copy constructors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107857 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/AST/ExprCXX.h27
-rw-r--r--include/clang/AST/RecursiveASTVisitor.h2
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td3
-rw-r--r--include/clang/Basic/StmtNodes.td2
-rw-r--r--include/clang/Frontend/PCHBitCodes.h2
5 files changed, 17 insertions, 19 deletions
diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h
index 6da32bacd3..aacb000860 100644
--- a/include/clang/AST/ExprCXX.h
+++ b/include/clang/AST/ExprCXX.h
@@ -822,12 +822,8 @@ 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. 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.
+/// constructor to build a temporary object. With N == 1 arguments the
+/// functional cast expression will be represented by CXXFunctionalCastExpr.
/// Example:
/// @code
/// struct X { X(int, float); }
@@ -861,22 +857,21 @@ public:
static bool classof(const CXXTemporaryObjectExpr *) { return true; }
};
-/// CXXZeroInitValueExpr - [C++ 5.2.3p2]
+/// CXXScalarValueInitExpr - [C++ 5.2.3p2]
/// Expression "T()" which creates a value-initialized rvalue of type
-/// T, which is either a non-class type or a class type without any
-/// user-defined constructors.
+/// T, which is a non-class type.
///
-class CXXZeroInitValueExpr : public Expr {
+class CXXScalarValueInitExpr : public Expr {
SourceLocation TyBeginLoc;
SourceLocation RParenLoc;
public:
- CXXZeroInitValueExpr(QualType ty, SourceLocation tyBeginLoc,
+ CXXScalarValueInitExpr(QualType ty, SourceLocation tyBeginLoc,
SourceLocation rParenLoc ) :
- Expr(CXXZeroInitValueExprClass, ty, false, false),
+ Expr(CXXScalarValueInitExprClass, ty, false, false),
TyBeginLoc(tyBeginLoc), RParenLoc(rParenLoc) {}
- explicit CXXZeroInitValueExpr(EmptyShell Shell)
- : Expr(CXXZeroInitValueExprClass, Shell) { }
+ explicit CXXScalarValueInitExpr(EmptyShell Shell)
+ : Expr(CXXScalarValueInitExprClass, Shell) { }
SourceLocation getTypeBeginLoc() const { return TyBeginLoc; }
SourceLocation getRParenLoc() const { return RParenLoc; }
@@ -895,9 +890,9 @@ public:
}
static bool classof(const Stmt *T) {
- return T->getStmtClass() == CXXZeroInitValueExprClass;
+ return T->getStmtClass() == CXXScalarValueInitExprClass;
}
- static bool classof(const CXXZeroInitValueExpr *) { return true; }
+ static bool classof(const CXXScalarValueInitExpr *) { return true; }
// Iterators
virtual child_iterator child_begin();
diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h
index bf88aa084b..f734c9af52 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(CXXZeroInitValueExpr, {
+DEF_TRAVERSE_STMT(CXXScalarValueInitExpr, {
// 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 f88a0ae664..0883eab003 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -509,6 +509,9 @@ 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 bfdac746ce..a2f69730a0 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 CXXZeroInitValueExpr : DStmt<Expr>;
+def CXXScalarValueInitExpr : 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 f3fb053f3c..4da96044c5 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_ZERO_INIT_VALUE, // CXXZeroInitValueExpr
+ EXPR_CXX_SCALAR_VALUE_INIT, // CXXScalarValueInitExpr
EXPR_CXX_NEW, // CXXNewExpr
EXPR_CXX_DELETE, // CXXDeleteExpr
EXPR_CXX_PSEUDO_DESTRUCTOR, // CXXPseudoDestructorExpr