From 83863299d9eacc7744932228c9e84a87f58bda94 Mon Sep 17 00:00:00 2001 From: Herb Sutter Date: Wed, 28 Dec 2022 10:35:03 -0800 Subject: [PATCH] Fix operator error message --- source/parse.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/parse.h b/source/parse.h index 6f5e59a8e8..e717a5b5ca 100644 --- a/source/parse.h +++ b/source/parse.h @@ -1543,14 +1543,14 @@ class parser { auto op = curr().to_string(true); auto msg = "postfix unary " + op; - if (curr().type() == lexeme::Multiply ) { op += " (dereference)" ; } - else if (curr().type() == lexeme::Ampersand) { op += " (address-of)" ; } - else if (curr().type() == lexeme::Tilde ) { op += " (unary bit-complement)"; } + if (curr().type() == lexeme::Multiply ) { msg += " (dereference)" ; } + else if (curr().type() == lexeme::Ampersand) { msg += " (address-of)" ; } + else if (curr().type() == lexeme::Tilde ) { msg += " (unary bit-complement)"; } msg += " cannot be immediately followed by a (, identifier, or literal - add whitespace before " + op + " here if you meant binary " + op; - if (curr().type() == lexeme::Multiply ) { op += " (multiplication)" ; } - else if (curr().type() == lexeme::Ampersand) { op += " (bitwise and)" ; } - else if (curr().type() == lexeme::Tilde ) { op += " (binarybit-complement)"; } + if (curr().type() == lexeme::Multiply ) { msg += " (multiplication)" ; } + else if (curr().type() == lexeme::Ampersand) { msg += " (bitwise and)" ; } + else if (curr().type() == lexeme::Tilde ) { msg += " (binarybit-complement)"; } error(msg, false); break;