Commit 9fd7ac73 authored by Théotime Grohens's avatar Théotime Grohens Committed by Commit Bot

[torque] Improve error message in constexpr conditionals

This CL adds the incorrect return type of the conditional expression
in 'if constexpr' conditionals to the error message displayed
if the return type is different from 'constexpr bool'.

Change-Id: I58be4c140fa6fc475dc907a9ec872005fcb7d839
Reviewed-on: https://chromium-review.googlesource.com/1105768Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Théotime Grohens <theotime@google.com>
Cr-Commit-Position: refs/heads/master@{#53839}
parent 6bb82368
......@@ -565,7 +565,8 @@ const Type* ImplementationVisitor::Visit(IfStatement* stmt) {
if (!(expression_result.type() == TypeOracle::GetConstexprBoolType())) {
std::stringstream stream;
stream << "expression should return type \"constexpr bool\" but doesn't";
stream << "expression should return type constexpr bool "
<< "but returns type " << expression_result.type();
ReportError(stream.str());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment