-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FunctionDecl::getParamDecl
: Assertion i < getNumParams() && "Illegal param #"
failed
#102760
Comments
@llvm/issue-subscribers-clang-frontend Author: Vlad Serebrennikov (Endilll)
While reducing #77250, I stumbled upon the following assertion (https://godbolt.org/z/s77h5PEKv):
```cpp
auto __make_tuple = []< class _Tag, class... _Captures >(_Tag, _Captures...) {
return []< class _Fun >( _Fun) -> void
requires requires { 0; }
{};
};
template < class, class... _As > using T = __call_result_t< int, int >;
clang++: /root/llvm-project/clang/include/clang/AST/Decl.h:2674: clang::ParmVarDecl* clang::FunctionDecl::getParamDecl(unsigned int): Assertion `i < getNumParams() && "Illegal param #"' failed.
|
@llvm/issue-subscribers-c-20 Author: Vlad Serebrennikov (Endilll)
While reducing #77250, I stumbled upon the following assertion (https://godbolt.org/z/s77h5PEKv):
```cpp
auto __make_tuple = []< class _Tag, class... _Captures >(_Tag, _Captures...) {
return []< class _Fun >( _Fun) -> void
requires requires { 0; }
{};
};
template < class, class... _As > using T = __call_result_t< int, int >;
clang++: /root/llvm-project/clang/include/clang/AST/Decl.h:2674: clang::ParmVarDecl* clang::FunctionDecl::getParamDecl(unsigned int): Assertion `i < getNumParams() && "Illegal param #"' failed.
|
FunctionDecl::getParamDecl
: Assertion
i < getNumParams() && "Illegal param #"' failed`FunctionDecl::getParamDecl
: Assertion 'i < getNumParams() && "Illegal param #"' failed
FunctionDecl::getParamDecl
: Assertion 'i < getNumParams() && "Illegal param #"' failed
FunctionDecl::getParamDecl
: Assertion i < getNumParams() && "Illegal param #"
failed
Looks like a regression from clang-18: https://godbolt.org/z/TWhdfzvc3 |
@AaronBallman if there is an rc4, we should keep an eyes on this one |
Sorry for replying late. EDIT: I mean, 19. |
#89934 might be small enough to backport - major refactor of lambdas is strictly for clang 20+ |
…late decl (llvm#89934) In the last patch llvm#82310, we used template depths to tell if such alias decls contain lambdas, which is wrong because the lambda can also appear as a part of the default argument, and that would make `getTemplateInstantiationArgs` provide extra template arguments in undesired contexts. This leads to issue llvm#89853. Moreover, our approach for llvm#82104 was sadly wrong. We tried to teach `DeduceReturnType` to consider alias template arguments; however, giving these arguments in the context where they should have been substituted in a `TransformCallExpr` call is never correct. This patch addresses such problems by using a `RecursiveASTVisitor` to check if the lambda is contained by an alias `Decl`, as well as twiddling the lambda dependencies - we should also build a dependent lambda expression if the surrounding alias template arguments were dependent. Fixes llvm#89853 Fixes llvm#102760 Fixes llvm#105885 (cherry picked from commit b412ec5)
…late decl (llvm#89934) In the last patch llvm#82310, we used template depths to tell if such alias decls contain lambdas, which is wrong because the lambda can also appear as a part of the default argument, and that would make `getTemplateInstantiationArgs` provide extra template arguments in undesired contexts. This leads to issue llvm#89853. Moreover, our approach for llvm#82104 was sadly wrong. We tried to teach `DeduceReturnType` to consider alias template arguments; however, giving these arguments in the context where they should have been substituted in a `TransformCallExpr` call is never correct. This patch addresses such problems by using a `RecursiveASTVisitor` to check if the lambda is contained by an alias `Decl`, as well as twiddling the lambda dependencies - we should also build a dependent lambda expression if the surrounding alias template arguments were dependent. Fixes llvm#89853 Fixes llvm#102760 Fixes llvm#105885 (cherry picked from commit b412ec5)
While reducing #77250, I stumbled upon the following assertion (https://godbolt.org/z/s77h5PEKv):
Clang 20.0 crash:
The text was updated successfully, but these errors were encountered: