brintos

brintos / llvm-project-archived public Read only

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