Closed Quuxplusone closed 11 years ago
Attached rvalue-haspointerrep-assert.tar.xz
(1014064 bytes, application/x-xz): Testcase for isRValue && hasPointerRepresentation assert
Repro:
template<class Foo>
bool test(Foo f, int *array)
{
return false && false || array[f.get()];
}
One of the -Wparentheses warnings is trying to see if "array[f.get()]" is a
constant value, but one of the constant expression evaluators is choking on the
dependent expression.
llvm/tools/clang/lib/AST/ExprConstant.cpp:4489: bool EvaluatePointer(const
clang::Expr*, {anonymous}::LValue&, {anonymous}::EvalInfo&): Assertion `E-
>isRValue() && E->getType()->hasPointerRepresentation()' failed.
#4 0x00000000016a23c0 in EvaluatePointer (E=0x440c318, Result=..., Info=...)
at llvm/tools/clang/lib/AST/ExprConstant.cpp:4489
#5 0x00000000016a1a94 in (anonymous
namespace)::LValueExprEvaluator::VisitArraySubscriptExpr (this=0x7fffffff9db0,
E=0x440c340) at llvm/tools/clang/lib/AST/ExprConstant.cpp:4346
_Bug 16930 has been marked as a duplicate of this bug._
Fixed in r188716.
rvalue-haspointerrep-assert.tar.xz
(1014064 bytes, application/x-xz)