[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

Lei Wang via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 9 15:44:45 PST 2024


wlei-llvm wrote:

Here is the repro from our side. It's reduced by creduce, there are some unrelated error, the assertion is the real issue. 

```
typedef a;
template < typename b, b c > struct d {
  static constexpr b e = c;
};
typedef d< bool, true > f;
typedef d< bool, false > g;
template < bool, typename, typename > struct aa;
template < typename... > struct h;
template < typename i, typename j, typename ab, typename... k >
struct h< i, j, ab, k... >
    : aa< i::e, i, h<> >::l {};
template < typename > struct ad : g {};
template < typename b >
struct ae : ad<  b  >{};
template < typename ai, typename aj,
           bool = h< ae< ai >,  aj ,
                          aj  >::e >
class ak {
  template < typename >
  static f al(int);
public:
  typedef decltype(al< aj >(0)) l;
};
template < typename ai, typename aj >
struct am : ak< ai, aj >::l {};
template < bool , typename az, typename >
struct aa {
  typedef az l;
}template < typename ai, typename aj >
constexpr bool bj = am< ai, aj >::e;
template < typename bx, typename by >
concept bz =
    bj< bx , by >;
      template < typename... > class cy
template < typename m >
concept n =
    bz<  m , m > 
 template < typename b >
concept o =
    n<  b  >
template < a , typename > struct tuple_element;
template < typename p, typename r >
class cy< p, r > {};
template < a q, typename... t >
__tuple_element_t< q, cy<> > get( cy< t... > ) ;
class s ;
template < class w > class u {
  w begin() ;
};
template < typename x > class v {
  using y = x
   ;
  using dp = decltype(static_cast< y (*)() >(
      nullptr)()[{}])
      ;
  dp operator*()
}
template < typename x >
struct dr {
  using ds = x::dt;
  using dp = u< ds >;
}template < o x > class du {
  using   dr< x >
  ::dp;
}
enum class dy
class dz 
template < typename eb > struct ec : eb ;
template < typename... ed >
struct ee
     :ec< cy< ed... > > {};
template < o... ej > class ek {
public:
  using el = a;
  using dw =
      ee<  ej ... >;
  using dt = v< ek >
   ;
  dw operator[](el ) ;
};
class  {
  using eo =
       s ;
  using ep =
      ek< eo,  dz  >;
  using eq = du< ep >::dp;
  eq get(dy cat) {
  auto es = get(cat)
  auto et = es.begin();
  get< 0 >(*et)
```

https://github.com/llvm/llvm-project/pull/83842


More information about the cfe-commits mailing list