diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-08-03 16:26:46 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-08-03 16:26:46 +0000 |
commit | 1d394809b4f87414e4d84a5d335bc2ebf256d21d (patch) | |
tree | 5e67141700b7667b51565c6db0f3009d963fbc2c /clang/lib/Sema/SemaDecl.cpp | |
parent | 7823ee33073e3fb7a092bcb42d506539f929ac8e (diff) | |
download | bcm5719-llvm-1d394809b4f87414e4d84a5d335bc2ebf256d21d.tar.gz bcm5719-llvm-1d394809b4f87414e4d84a5d335bc2ebf256d21d.zip |
Make the type of the IntegerLiteral for bitfield paddings an actual
integer, and initialise its TypeSourceInfo. The initialisation fixes a
crash when using pre-compiled preambles with C++ code-completion. From
Erik Verbruggen! Fixes PR10511.
llvm-svn: 136786
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 4988323f41f..2b6cf312a16 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -8308,13 +8308,14 @@ void Sema::ActOnLastBitfield(SourceLocation DeclLoc, Decl *EnclosingDecl, return; } // All conditions are met. Add a new bitfield to the tail end of ivars. - llvm::APInt Zero(Context.getTypeSize(Context.CharTy), 0); - Expr * BW = IntegerLiteral::Create(Context, Zero, Context.CharTy, DeclLoc); + llvm::APInt Zero(Context.getTypeSize(Context.IntTy), 0); + Expr * BW = IntegerLiteral::Create(Context, Zero, Context.IntTy, DeclLoc); Ivar = ObjCIvarDecl::Create(Context, cast<ObjCContainerDecl>(EnclosingDecl), DeclLoc, DeclLoc, 0, Context.CharTy, - Context.CreateTypeSourceInfo(Context.CharTy), + Context.getTrivialTypeSourceInfo(Context.CharTy, + DeclLoc), ObjCIvarDecl::Private, BW, true); AllIvarDecls.push_back(Ivar); |