From e90feb3d847f26943d68e31f735f0715504b8ebf Mon Sep 17 00:00:00 2001 From: chrchr Date: Tue, 30 Jan 2024 18:27:22 +0100 Subject: [PATCH] Add test --- test/testother.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/testother.cpp b/test/testother.cpp index 4f12bf4f622..1e04635af9d 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -7371,6 +7371,16 @@ class TestOther : public TestFixture { " if (std::is_same_v || std::is_same_v) {}\n" "}\n"); ASSERT_EQUALS("", errout.str()); + + checkP("#define F(v) (v) != 0\n" // #12392 + "template\n" + "void f() {\n" + " if (F(0)) {}\n" + "}\n" + "void g() {\n" + " f();\n" + "}\n"); + ASSERT_EQUALS("", errout.str()); } void duplicateExpressionCompareWithZero() {