summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/Sema.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-11-05 15:29:30 +0000
committerDouglas Gregor <dgregor@apple.com>2008-11-05 15:29:30 +0000
commit6f5431543a701c54293a977c28844e9862f8f491 (patch)
treef3b6e7832720b29d309135362b053bea120af5d5 /clang/lib/Sema/Sema.h
parentbfd58d87f31f4c24604965d919b8bbdaa6ac9ff6 (diff)
downloadbcm5719-llvm-6f5431543a701c54293a977c28844e9862f8f491.tar.gz
bcm5719-llvm-6f5431543a701c54293a977c28844e9862f8f491.zip
Implement C++ copy-initialization for declarations. There is now some
duplication in the handling of copy-initialization by constructor, which occurs both for initialization of a declaration and for overloading. The initialization code is due for some refactoring. llvm-svn: 58756
Diffstat (limited to 'clang/lib/Sema/Sema.h')
-rw-r--r--clang/lib/Sema/Sema.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h
index 72b56deca37..d14c5ffa200 100644
--- a/clang/lib/Sema/Sema.h
+++ b/clang/lib/Sema/Sema.h
@@ -708,11 +708,20 @@ public:
SourceLocation *CommaLocs,
SourceLocation RParenLoc);
+ /// InitializationKind - Represents which kind of C++ initialization
+ /// [dcl.init] a routine is to perform.
+ enum InitializationKind {
+ IK_Direct, ///< Direct initialization
+ IK_Copy, ///< Copy initialization
+ IK_Default ///< Default initialization
+ };
+
CXXConstructorDecl *
- PerformDirectInitForClassType(QualType ClassType,
- Expr **Args, unsigned NumArgs,
- SourceLocation Loc, SourceRange Range,
- std::string InitEntity, bool HasInitializer);
+ PerformInitializationByConstructor(QualType ClassType,
+ Expr **Args, unsigned NumArgs,
+ SourceLocation Loc, SourceRange Range,
+ std::string InitEntity,
+ InitializationKind Kind);
/// ActOnCXXNamedCast - Parse {dynamic,static,reinterpret,const}_cast's.
virtual ExprResult ActOnCXXNamedCast(SourceLocation OpLoc, tok::TokenKind Kind,
@@ -1146,7 +1155,8 @@ private:
/// type checking declaration initializers (C99 6.7.8)
friend class InitListChecker;
- bool CheckInitializerTypes(Expr *&simpleInit_or_initList, QualType &declType);
+ bool CheckInitializerTypes(Expr *&simpleInit_or_initList, QualType &declType,
+ SourceLocation InitLoc, std::string InitEntity);
bool CheckSingleInitializer(Expr *&simpleInit, QualType declType);
bool CheckForConstantInitializer(Expr *e, QualType t);
bool CheckArithmeticConstantExpression(const Expr* e);
OpenPOWER on IntegriCloud