This fixes the following:
******************** TEST 'Parser/cxx-bool.cpp' FAILED! ********************
Command:
clang -fsyntax-only Parser/cxx-bool.cpp
Output:
SemaExpr.cpp:731: failed assertion `!t.isNull() && "DefaultFunctionArrayConversion - missing type"'
Output/cxx-bool.cpp.out.script: line 1: 22697 Abort trap clang -fsyntax-only Parser/cxx-bool.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41401
91177308-0d34-0410-b5e6-
96231b3b80d8
#include "Sema.h"
#include "clang/AST/ExprCXX.h"
+#include "clang/AST/ASTContext.h"
using namespace clang;
/// ParseCXXCasts - Parse {dynamic,static,reinterpret,const}_cast's.
Sema::ParseCXXBoolLiteral(SourceLocation OpLoc, tok::TokenKind Kind) {
assert((Kind != tok::kw_true || Kind != tok::kw_false) &&
"Unknown C++ Boolean value!");
- return new CXXBoolLiteralExpr(Kind == tok::kw_true, OpLoc);
+ return new CXXBoolLiteralExpr(Kind == tok::kw_true, Context.BoolTy, OpLoc);
}
bool Value;
SourceLocation Loc;
public:
- CXXBoolLiteralExpr(bool val, SourceLocation l) :
- Expr(CXXBoolLiteralExprClass, QualType()), Value(val), Loc(l) {}
+ CXXBoolLiteralExpr(bool val, QualType Ty, SourceLocation l) :
+ Expr(CXXBoolLiteralExprClass, Ty), Value(val), Loc(l) {}
bool getValue() const { return Value; }