summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-06-10 03:12:00 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-06-10 03:12:00 +0000
commit2b013185f8b33f3bcd261e1b34bf61a22d48122b (patch)
treeb0f6cbcd6809071797cea6db07253ef2f7449d9e /clang/lib/AST/Decl.cpp
parent02b3d81a97365072632ee53bfe19a1b3cea542c5 (diff)
downloadbcm5719-llvm-2b013185f8b33f3bcd261e1b34bf61a22d48122b.tar.gz
bcm5719-llvm-2b013185f8b33f3bcd261e1b34bf61a22d48122b.zip
PR13064: Store whether an in-class initializer uses direct or copy
initialization, and use that information to produce the right kind of initialization during template instantiation. llvm-svn: 158288
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index ee90b23e5c2..3a002918163 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -2465,15 +2465,15 @@ FieldDecl *FieldDecl::Create(const ASTContext &C, DeclContext *DC,
SourceLocation StartLoc, SourceLocation IdLoc,
IdentifierInfo *Id, QualType T,
TypeSourceInfo *TInfo, Expr *BW, bool Mutable,
- bool HasInit) {
+ InClassInitStyle InitStyle) {
return new (C) FieldDecl(Decl::Field, DC, StartLoc, IdLoc, Id, T, TInfo,
- BW, Mutable, HasInit);
+ BW, Mutable, InitStyle);
}
FieldDecl *FieldDecl::CreateDeserialized(ASTContext &C, unsigned ID) {
void *Mem = AllocateDeserializedDecl(C, ID, sizeof(FieldDecl));
return new (Mem) FieldDecl(Field, 0, SourceLocation(), SourceLocation(),
- 0, QualType(), 0, 0, false, false);
+ 0, QualType(), 0, 0, false, ICIS_NoInit);
}
bool FieldDecl::isAnonymousStructOrUnion() const {
@@ -2525,10 +2525,9 @@ SourceRange FieldDecl::getSourceRange() const {
}
void FieldDecl::setInClassInitializer(Expr *Init) {
- assert(!InitializerOrBitWidth.getPointer() &&
+ assert(!InitializerOrBitWidth.getPointer() && hasInClassInitializer() &&
"bit width or initializer already set");
InitializerOrBitWidth.setPointer(Init);
- InitializerOrBitWidth.setInt(0);
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud