llvm-project/clang/test/SemaCXX/remove-nested-immediate-invocation-crash.cpp
Dmitry Polukhin 133b6d7db9 [clang][C++20] Fix clang/clangd assert/crash after compilation errors
After compilation errors, expression a transformation result may not be usable.
It triggers an assert in RemoveNestedImmediateInvocation and SIGSEGV in case of
builds without asserts. This issue significantly affects clangd because source
may not be valid during typing. Tests cases that I attached was reduce from huge
C++ translation unit.

Test Plan: check-clang

Differential Revision: https://reviews.llvm.org/D133948
2022-09-17 07:37:19 -07:00

12 lines
386 B
C++

// RUN: not %clang_cc1 -fsyntax-only -verify -std=gnu++20 -ferror-limit 19 %s
// Creduced test case for the crash in RemoveNestedImmediateInvocation after compliation errros.
a, class b { template < typename c> consteval b(c
} template <typename...> using d = b;
auto e(d<>) -> int:;
}
f
}
g() {
auto h = "":(::i(e(h))