brintos

brintos / llvm-project-archived public Read only

0
0
Text · 838 B · 06a496e Raw
42 lines · cpp
1// RUN: %clang_cc1 -std=c++20 -triple x86_64-elf-gnu %s -emit-llvm -o - | FileCheck %s2 3namespace GH56652{4 5struct foo {};6 7template <typename T> struct bar {8    using type = T;9 10    template <foo> inline static constexpr auto b = true;11};12 13template <typename T>14concept C = requires(T a) { T::template b<foo{}>; };15 16template <typename T> auto fn(T) {17    if constexpr (!C<T>)18        return foo{};19    else20        return T{};21}22 23auto a = decltype(fn(bar<int>{})){};24 25}26 27namespace GH116319 {28 29template <int = 0> struct a {30template <class> static constexpr auto b = 2;31template <class> static void c() noexcept(noexcept(b<int>)) {}32};33 34void test() { a<>::c<int>(); }35 36 37}38 39// CHECK: %"struct.GH56652::bar" = type { i8 }40// CHECK: $_ZN8GH1163191aILi0EE1cIiEEvv = comdat any41// CHECK: @_ZN7GH566521aE = global %"struct.GH56652::bar" undef42