Files
swift-mirror/test/Interop/Cxx/concepts/Inputs/method-requires.h
Egor Zhdan 2c00ae939b [cxx-interop] Adjust a concepts test for rebranch
Clang now includes concepts in the mangled names of C++ functions: 4b163e343c

This adjusts the test to verify that we don't transitively emit the symbols referenced from the requires expression. Those symbols shouldn't be emitted because they are not executed.

rdar://127263407
2024-07-08 17:59:21 +01:00

14 lines
329 B
C++

inline void shouldNotBeCalledOrEmitted(int) {}
inline void calledFromConceptBody(int x) { shouldNotBeCalledOrEmitted(x); }
inline void calledFromMethodBody(int x) {}
struct MyStruct {
template <typename T>
void foo(T x)
requires requires(const T x) { calledFromConceptBody(x); }
{
calledFromMethodBody(x);
}
};