brintos

brintos / llvm-project-archived public Read only

0
0
Text · 834 B · e8ea164 Raw
25 lines · cpp
1// RUN: %clang_cc1 -std=c++20 -verify %s2 3namespace PR46377 {4  template<typename> using IntPtr = int*;5  template<typename ...T> auto non_dependent_typedef() {6    typedef int(*P)(IntPtr<T>...);7    return P();8  }9  template<typename ...T> auto non_dependent_alias() {10    using P = int(*)(IntPtr<T>...);11    return P();12  }13  template<typename ...T> auto non_dependent_via_sizeof() {14    using P = int(*)(int(...pack)[sizeof(sizeof(T))]); // expected-error {{invalid application of 'sizeof'}}15    return P();16  }17 18  using a = int (*)(int*, int*);19  using a = decltype(non_dependent_typedef<void, void>());20  using a = decltype(non_dependent_alias<void, void>());21  using a = decltype(non_dependent_via_sizeof<float, float>());22 23  using b = decltype(non_dependent_via_sizeof<float, void>()); // expected-note {{instantiation of}}24}25