================ @@ -0,0 +1,32 @@ +// RUN: rm -fR %t +// RUN: split-file %s %t +// RUN: cd %t +// RUN: %clang_cc1 -verify -std=c++20 -fskip-odr-check-in-gmf -emit-header-unit -xc++-user-header bz0.h +// RUN: %clang_cc1 -verify -std=c++20 -fskip-odr-check-in-gmf -emit-header-unit -xc++-user-header bz1.h +// RUN: %clang_cc1 -verify -std=c++20 -fskip-odr-check-in-gmf -emit-header-unit -xc++-user-header -fmodule-file=bz0.pcm -fmodule-file=bz1.pcm bz.cpp + +//--- compare +template<typename _Tp> +inline constexpr unsigned __cmp_cat_id = 1; + +template<typename... _Ts> +constexpr auto __common_cmp_cat() { + (__cmp_cat_id<_Ts> | ...); +} + +//--- bz0.h +template <class T> +int operator|(T, T); + +#include "compare" ---------------- dmpolukhin wrote:
I updated test case to be closer to the real issue with gcc libstdc++. The test case is identical to [polluted-operator.cppm](https://github.com/llvm/llvm-project/blob/main/clang/test/Modules/polluted-operator.cppm) but with header units. Depending on include order it has ODR or not, it is non-intentional violation that is hard to avoid at sale. https://github.com/llvm/llvm-project/pull/111160 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits