// RUN: rm -rf %t // RUN: mkdir -p %t // RUN: split-file %s %t // // RUN: %clang_cc1 -std=c++20 %t/type_traits.cppm -emit-module-interface -o %t/type_traits.pcm // RUN: %clang_cc1 -std=c++20 %t/test.cpp -fprebuilt-module-path=%t -verify //--- type_traits.cppm export module type_traits; export template constexpr bool is_pod_v = __is_pod(T); //--- test.cpp // expected-no-diagnostics import type_traits; // Base is either void or wrapper. template struct wrapper : Base {}; template <> struct wrapper {}; // wrap<0>::type is wrapper, wrap<1>::type is wrapper>, // and so on. template struct wrap { template using type = wrapper::template type>; }; template <> struct wrap<0> { template using type = wrapper; }; inline constexpr int kMaxRank = 40; template using rank = typename wrap::template type; using rank_selector_t = rank; static_assert(is_pod_v, "Must be POD");