| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 -fcoverage-mapping %s |
| 2 |
// expected-no-diagnostics |
| 3 |
|
| 4 |
// GH62105 demonstrated a crash with this example code when calculating |
| 5 |
// coverage mapping because some source location information was being dropped. |
| 6 |
// Demonstrate that we do not crash on this code. |
| 7 |
namespace std { template <typename E> class initializer_list { const E *a, *b; }; } |
| 8 |
|
| 9 |
template <typename> struct T { |
| 10 |
T(std::initializer_list<int>, int = int()); |
| 11 |
bool b; |
| 12 |
}; |
| 13 |
|
| 14 |
template <typename> struct S1 { |
| 15 |
static void foo() { |
| 16 |
class C; |
| 17 |
(void)(0 ? T<C>{} : T<C>{}); |
| 18 |
} |
| 19 |
}; |
| 20 |
|
| 21 |
void bar() { |
| 22 |
S1<int>::foo(); |
| 23 |
} |
| 24 |
|