41 lines · cpp
1// RUN: rm -fR %t2// RUN: split-file %s %t3// RUN: cd %t4// RUN: %clang_cc1 -verify -std=c++20 -fskip-odr-check-in-gmf -I. -emit-header-unit -xc++-user-header bz1.h5// RUN: %clang_cc1 -verify -std=c++20 -fskip-odr-check-in-gmf -I. -emit-header-unit -xc++-user-header bz2.h6// RUN: %clang_cc1 -verify -std=c++20 -fskip-odr-check-in-gmf -I. -emit-header-unit -xc++-user-header -fmodule-file=bz1.pcm -fmodule-file=bz2.pcm bz.cpp7 8//--- compare9namespace std {10namespace __detail {11 12template<typename _Tp>13inline constexpr unsigned __cmp_cat_id = 1;14 15template<typename... _Ts>16constexpr auto __common_cmp_cat() {17 (__cmp_cat_id<_Ts> | ...);18}19 20} // namespace __detail21} // namespace std22 23//--- bz0.h24template <class T>25int operator|(T, T);26 27//--- bz1.h28#include "bz0.h"29#include <compare>30// expected-no-diagnostics31 32//--- bz2.h33#include <compare>34// expected-no-diagnostics35 36//--- bz.cpp37#include <compare>38 39import "bz1.h"; // expected-warning {{the implementation of header units is in an experimental phase}}40import "bz2.h"; // expected-warning {{the implementation of header units is in an experimental phase}}41