-
Notifications
You must be signed in to change notification settings - Fork 15k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]regression:17Regression in 17 releaseRegression in 17 release
Description
There is an assertion error when built with assertions enabled:
clang++: /root/build/tools/clang/include/clang/AST/TypeNodes.inc:77: clang::TypeInfo clang::ASTContext::getTypeInfoImpl(const clang::Type*) const: Assertion `!T->isDependentType() && "should not see dependent types here"' failed.
The reproducer:
template <typename T> auto id(const T &obj) -> decltype(obj.identifier());
template <typename T> struct ContainedId {
auto operator()(const T &obj) -> decltype(id(obj));
};
template <class T, class = decltype(ContainedId<T>{}.operator()(T{}))>
class Container {};
class Contained {
public:
int identifier();
};
class Collection {
Container<Contained> m_changesToPersist;
};
Collection collection;
This is a regression from clang 17: https://godbolt.org/z/x5ezKnf79
I have bisected this, and I think it was introduced by #75456
Note that the crash happens because identifier
can not be resolved due to const-nedness, adding a const
makes the problem go away and the code compiles.
This is a detail, just making it possible not to resolve identifier
(by renaming, deleting, etc.) is enough to trigger the crash.
The two levels of indirection are relevant: Container<Contained> -> ContainedId<Contained> -> id
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]regression:17Regression in 17 releaseRegression in 17 release
Type
Projects
Status
No status