Open iamanonymouscs opened 2 months ago
@llvm/issue-subscribers-clang-frontend
Author: Anonymous (iamanonymouscs)
Looks like this started after clang-10: https://godbolt.org/z/fhceaK86T
Current assertions trunk: https://godbolt.org/z/qT84fjbsd
Assertion:
clang++: /root/llvm-project/clang/include/clang/AST/DeclarationName.h:503:
void* clang::DeclarationName::getFETokenInfo() const:
Assertion `getPtr() && "getFETokenInfo on an empty DeclarationName!"' failed.
Much reduced: https://godbolt.org/z/aMx8v94d5
#include <string> // Need this include
struct A {
A* data[2];
};
template <typename T>
void f1(unsigned long, const A& f, const A& b = {});
template <>
void f1<A>(unsigned long size, const A& f, const A& b) { // We also need b
f1<A>(0, *f.data[0]); // We still need this line
size; // Changing the name of size prevents crash
}
This is an odd one, we require the include and the name of size
to be that name. There much be a size
variable/type we are mixing up from <string>
.
CC @Endilll I am hoping a reduction will help clarify the issue.
Reduced by C-Reduce (https://godbolt.org/z/3T7h8E43P):
template <typename _Container>
constexpr auto
size(const _Container &__cont) noexcept -> decltype(__cont.size0);
struct A {
A* data[2];
};
template <typename T>
void f1(unsigned long, const A& f, const A& b = {});
template <>
void f1<A>(unsigned long size, const A& f, const A& b) { // We also need b
f1<A>(0, *f.data[0]); // We still need this line
size; // Changing the name of size prevents crash
}
Wait this looks like exactly the same issue as: https://github.com/llvm/llvm-project/issues/60066
which was closed as a duplicate of: https://github.com/llvm/llvm-project/issues/54279
although it is not clear to me they are totally related.
Description:
When compiling the following C++ code using Clang version 19.0.0 on Ubuntu, an internal compiler error occurs, leading to a stack dump and failure to compile.
Also ICE on trunk, compiler explorer:https:https://godbolt.org/z/158z8qv81
OS and Platform:
Program:
Command Lines: