From 35f14962fc901f363c38ddeeb05ccfa4513669d4 Mon Sep 17 00:00:00 2001 From: Paul Fultz II Date: Sat, 4 Dec 2021 10:03:02 -0600 Subject: [PATCH] Regression test for 9523: Syntax Error: AST broken, 'if' doesn't have two operands. (#3602) --- test/testtokenize.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 222967d19..15982be83 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -6719,6 +6719,16 @@ private: " ;\n" "}\n")); + // #9523 + ASSERT_NO_THROW(tokenizeAndStringify( + "template struct a;\n" + "template struct b;\n" + "template struct b::d> {\n" + " void e() {\n" + " if (0) {}\n" + " }\n" + "};\n")); + ASSERT_NO_THROW(tokenizeAndStringify( "template \n" "constexpr void constexpr_for_fold_impl([[maybe_unused]] Functor&& f, std::index_sequence) noexcept {\n"