LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 38055 - misc-unused-parameters causes an assertion failure in clang::CallExpr::getArg(unsigned int) const: Arg < NumArgs && "Arg access out of range!"
Summary: misc-unused-parameters causes an assertion failure in clang::CallExpr::getArg...
Status: RESOLVED FIXED
Alias: None
Product: clang-tools-extra
Classification: Unclassified
Component: clang-tidy (show other bugs)
Version: unspecified
Hardware: PC Linux
: P enhancement
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-04 07:40 PDT by Alexander Kornienko
Modified: 2018-07-04 08:21 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kornienko 2018-07-04 07:40:27 PDT
$ cat test-UnusedParametersCheck__warnOnUnusedParameter.cc
namespace {
struct a {
  void b(unsigned c) {}
};
template <class>
class d {
  a e;
  void f() { e.b(); }
};
}  // namespace
$ ./clang-tidy -checks=-*,misc-unused-parameters test-UnusedParametersCheck__warnOnUnusedParameter.cc --
assertion failed at llvm/tools/clang/include/clang/AST/Expr.h:2301 in const clang::Expr *clang::CallExpr::getArg(unsigned int) const: Arg < NumArgs && "Arg access out of range!"
    @     0x55cec6baa026  __assert_fail
    @     0x55cec4450e33  clang::tidy::misc::UnusedParametersCheck::warnOnUnusedParameter()
    @     0x55cec445109c  clang::tidy::misc::UnusedParametersCheck::check()
    @     0x55cec49fe56d  clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::MatchVisitor::visitMatch()
    @     0x55cec4a221f4  clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches()
    @     0x55cec49fdc04  clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::matchWithFilter()
    @     0x55cec49c666e  clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl()
    @     0x55cec4a00ce9  clang::RecursiveASTVisitor<>::TraverseCXXRecordDecl()
    @     0x55cec49c7a2c  clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl()
    @     0x55cec49ff509  clang::RecursiveASTVisitor<>::TraverseNamespaceDecl()
    @     0x55cec49c79b4  clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl()
    @     0x55cec4a03199  clang::RecursiveASTVisitor<>::TraverseTranslationUnitDecl()
    @     0x55cec49c7c60  clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl()
    @     0x55cec49c63dc  clang::ast_matchers::MatchFinder::matchAST()
    @     0x55cec4c134dc  clang::MultiplexConsumer::HandleTranslationUnit()
Comment 1 Alexander Kornienko 2018-07-04 08:21:26 PDT
Fixed in r336283.