Open DimitryAndric opened 4 months ago
@llvm/issue-subscribers-c-14
Author: Dimitry Andric (DimitryAndric)
@llvm/issue-subscribers-c-20
Author: Dimitry Andric (DimitryAndric)
@llvm/issue-subscribers-clang-frontend
Author: Dimitry Andric (DimitryAndric)
If there's no movement on this issue, can we revert 4b163e343cf for now?
@zygoloid
If there's no movement on this issue, can we revert 4b163e3 for now?
I don't think that would be a good idea -- it would introduce a lot of ABI churn to revert and then later reapply an ABI change we've already shipped.
Can you work around this with -fclang-abi-compat=17
?
-fclang-abi-compat=17
makes both the reduced and the original full test case work, so I guess for the FreeBSD port that is a good enough workaround. But it would be nice to have the assertion fixed at some point. :)
If someone wants to take a look, here's a further reduced testcase:
template<bool> struct A;
template<typename> struct B {
static constexpr bool value = 0;
};
template<class T, template <class> class TT>
using C = A<TT<T>::value>;
template<class T, C<T, B>* = nullptr> void f() {}
template void f<int>();
A clue:
template<bool> struct A;
template<typename> struct B {
static constexpr bool value = false;
};
template<
#if BAD
class T,
#endif
template <class> class TT>
using C = A<TT<int>::value>;
template<template<class> class TT,
C<
#if BAD
int,
#endif
TT>* = nullptr> void f() {}
template void f<B>();
... crashes with #define BAD
but not without. This probably suggests some confusion between the template parameters of C
and the template parameters of one of the other involved templates in mangling, likely because expansion of the alias template has muddled together template parameter references into different templates.
As reported in https://bugs.freebsd.org/278333, clang 18 asserts on the
audio/noise-suppression-for-voice-lv2
port, with:This regressed with 4b163e343cfa54c8d55c9da73c70d58f55ea9df2 ("Implement mangling rules for C++20 concepts and requires-expressions") by @zygoloid, cc @erichkeane @AaronBallman @rjmccall .
Minimized test case: