33 lines · cpp
1// RUN: %clang_cc1 -std=c++14 %s -triple=x86_64-linux -emit-llvm -o - | FileCheck %s2 3struct f {4 void operator()() const {}5};6 7template <typename T> auto vtemplate = f{};8 9int main() { vtemplate<int>(); }10 11// CHECK: @_Z9vtemplateIiE = linkonce_odr global %struct.f undef, comdat12 13// CHECK: define{{.*}} i32 @main()14// CHECK: call void @_ZNK1fclEv(ptr {{[^,]*}} @_Z9vtemplateIiE)15 16template <typename>17struct pack {18 template <typename T>19 constexpr static auto some_boolean_cx_value = true;20};21 22auto usage() {23 return pack<char>::some_boolean_cx_value<int>;24}25 26// CHECK: define{{.*}} i1 @_Z5usagev()27 28auto otherusage() {29 return pack<char>{}.some_boolean_cx_value<int>;30}31 32// CHECK: define{{.*}} i1 @_Z10otherusagev()33