Regression test for 9523: Syntax Error: AST broken, 'if' doesn't have two operands. (#3602)

This commit is contained in:
Paul Fultz II 2021-12-04 10:03:02 -06:00 committed by GitHub
parent a03e731930
commit 35f14962fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -6719,6 +6719,16 @@ private:
" ;\n" " ;\n"
"}\n")); "}\n"));
// #9523
ASSERT_NO_THROW(tokenizeAndStringify(
"template <int> struct a;\n"
"template <typename, typename> struct b;\n"
"template <typename c> struct b<c, typename a<c{} && 0>::d> {\n"
" void e() {\n"
" if (0) {}\n"
" }\n"
"};\n"));
ASSERT_NO_THROW(tokenizeAndStringify( ASSERT_NO_THROW(tokenizeAndStringify(
"template <std::size_t First, std::size_t... Indices, typename Functor>\n" "template <std::size_t First, std::size_t... Indices, typename Functor>\n"
"constexpr void constexpr_for_fold_impl([[maybe_unused]] Functor&& f, std::index_sequence<Indices...>) noexcept {\n" "constexpr void constexpr_for_fold_impl([[maybe_unused]] Functor&& f, std::index_sequence<Indices...>) noexcept {\n"