[clang] [clang] SourceLocIdentKind::Function should not be dependent (PR #94942)
Qizhi Hu via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 13 19:44:49 PDT 2024
jcsxky wrote:
```cpp
struct BasicPersistent;
struct SourceLocation {
static constexpr const char* Current(const char * func = __builtin_FUNCTION()) {
return func;
}
};
template <typename> BasicPersistent &&__declval(int);
template <typename _Tp> auto declval() -> decltype(__declval<_Tp>(0));
template <typename _Tp> _Tp forward;
template <typename _Tp, typename... _Args>
auto construct_at(_Tp *, _Args...) -> decltype(new _Tp(declval<_Args>()...)) {
constexpr auto *F = SourceLocation::Current();
static_assert(__builtin_strlen(F) == 12);
return 0;
}
template <typename> struct allocator;
template <typename> struct allocator_traits;
template <typename _Tp> struct allocator_traits<allocator<_Tp>> {
using pointer = _Tp *;
template <typename _Up, typename... _Args>
static void construct(_Up __p, _Args...) {
construct_at(__p, forward<_Args>...);
}
};
struct __alloc_traits : allocator_traits<allocator<BasicPersistent>> {
} push_back___x;
__alloc_traits::pointer _M_impl_0;
template <typename... _Args> void emplace_back(_Args...) {
__alloc_traits::construct(_M_impl_0, forward<_Args>...);
}
struct BasicPersistent {
BasicPersistent(BasicPersistent &&,
const char* = SourceLocation::Current()) {}
};
void CFXJSE_EngineAddObjectToUpArray() { emplace_back(push_back___x); }
```
I modify the testcase as above and I think we just need to make dependent if Kind is `SourceLocIdentKind::SourceLocStruct`. Could you please take another look? @cor3ntin
https://github.com/llvm/llvm-project/pull/94942
More information about the cfe-commits
mailing list