[cfe-commits] r148157 - in /cfe/trunk: lib/AST/ExprConstant.cpp test/SemaCXX/constant-expression-cxx11.cpp
Eli Friedman
eli.friedman at gmail.com
Fri Jan 13 15:34:56 PST 2012
Author: efriedma
Date: Fri Jan 13 17:34:56 2012
New Revision: 148157
URL: http://llvm.org/viewvc/llvm-project?rev=148157&view=rev
Log:
Fix a silly mistake in ComplexExprEvaluator::ZeroInitialization. <rdar://problem/10691092>.
Modified:
cfe/trunk/lib/AST/ExprConstant.cpp
cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp
Modified: cfe/trunk/lib/AST/ExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=148157&r1=148156&r2=148157&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExprConstant.cpp (original)
+++ cfe/trunk/lib/AST/ExprConstant.cpp Fri Jan 13 17:34:56 2012
@@ -4914,7 +4914,7 @@
}
bool ComplexExprEvaluator::ZeroInitialization(const Expr *E) {
- QualType ElemTy = cast<ComplexType>(E->getType())->getElementType();
+ QualType ElemTy = E->getType()->getAs<ComplexType>()->getElementType();
if (ElemTy->isRealFloatingType()) {
Result.makeComplexFloat();
APFloat Zero = APFloat::getZero(Info.Ctx.getFloatTypeSemantics(ElemTy));
Modified: cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp?rev=148157&r1=148156&r2=148157&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp (original)
+++ cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp Fri Jan 13 17:34:56 2012
@@ -998,4 +998,6 @@
constexpr _Complex int test4 = {4};
constexpr _Complex int test5 = 4;
constexpr _Complex int test6 = {5,6};
+ typedef _Complex float fcomplex;
+ constexpr fcomplex test7 = fcomplex();
}
More information about the cfe-commits
mailing list