llvm-project/clang/test/SemaCXX/template-specialization-fatal.cpp
Adam Czachorowski ddfbdbfefa [clang] Do not crash on template specialization following a fatal error
There was a missing isInvalid() check leading to an attempt to
instantiate template with an empty instantiation stack.

Differential Revision: https://reviews.llvm.org/D100675
2021-04-23 13:34:05 +02:00

12 lines
390 B
C++

// RUN: %clang_cc1 -verify -fsyntax-only %s
// Verify clang doesn't assert()-fail on template specialization happening after
// fatal error.
#include "not_found.h" // expected-error {{'not_found.h' file not found}}
template <class A, class B, class = void>
struct foo {};
template <class A, class B>
struct foo<A, B, decltype(static_cast<void (*)(B)>(0)(static_cast<A (*)()>(0)()))> {};