llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.22k stars 11.65k forks source link

Access violation at instantiating variable definition 'std::_Is_ranges_input_iter_v...' #88532

Open alabuzhev opened 5 months ago

alabuzhev commented 5 months ago

See the attached Access_violation_Is_ranges_input_iter_v.zip

It works fine with this change (lines 354266-354267):

-  numbered_iterator_t operator++(int) = delete;
-  numbered_iterator_t operator--(int) = delete;
+  auto operator++(int) { auto Copy = *this; ++*this; return Copy; }
+  auto operator--(int) { auto Copy = *this; --*this; return Copy; }

I guess without postifx forms the type doesn't model std::weakly_incrementable properly, but it's probably not a reason to crash.

llvmbot commented 5 months ago

@llvm/issue-subscribers-clang-frontend

Author: Alex Alabuzhev (alabuzhev)

See the attached [Access_violation_Is_ranges_input_iter_v.zip](https://github.com/llvm/llvm-project/files/14960942/Access_violation_Is_ranges_input_iter_v.zip) It works fine with this change (lines 354266-354267): ```DIFF - numbered_iterator_t operator++(int) = delete; - numbered_iterator_t operator--(int) = delete; + auto operator++(int) { auto Copy = *this; ++*this; return Copy; } + auto operator--(int) { auto Copy = *this; --*this; return Copy; } ``` I guess without postifx forms the type doesn't model `std::weakly_incrementable` properly, but it's probably not a reason to crash.
Endilll commented 4 months ago

Assertions build of Clang 18.1.0 is crashing:

In file included from editor.cpp:39:
In file included from .\editor.hpp:40:
In file included from .\stddlg.hpp:40:
.\dialog.hpp(209,94): error: use of old-style cast [-Werror,-Wold-style-cast]
  209 |  void SetPluginOwner(Plugin* NewPluginAddress) {PluginOwner = ((NewPluginAddress == ((HANDLE)(LONG_PTR)-1))? nullptr : NewPluginAddress);}
      |                                                                                              ^         ~~
.\dialog.hpp(209,86): error: use of old-style cast [-Werror,-Wold-style-cast]
  209 |  void SetPluginOwner(Plugin* NewPluginAddress) {PluginOwner = ((NewPluginAddress == ((HANDLE)(LONG_PTR)-1))? nullptr : NewPluginAddress);}
      |                                                                                      ^       ~~~~~~~~~~~~
In file included from editor.cpp:48:
In file included from .\fileedit.hpp:46:
In file included from .\platform.fs.hpp:39:
.\platform.hpp(216,23): error: use of old-style cast [-Werror,-Wold-style-cast]
  216 |   NTSTATUS NtError = ((NTSTATUS)0x00000000L);
      |                       ^         ~~~~~~~~~~~
.\platform.hpp(221,34): error: use of old-style cast [-Werror,-Wold-style-cast]
  221 |    return Win32Error != 0L || !(((NTSTATUS)(NtError)) >= 0);
      |                                  ^         ~~~~~~~~~
In file included from editor.cpp:48:
In file included from .\fileedit.hpp:46:
.\platform.fs.hpp(112,27): error: use of old-style cast [-Werror,-Wold-style-cast]
  112 |   attributes Attributes{ ((DWORD)-1) };
      |                           ^      ~~
In file included from editor.cpp:57:
.\wakeful.hpp(51,51): error: use of old-style cast [-Werror,-Wold-style-cast]
   51 |  wakeful():PreviousState(SetThreadExecutionState(((DWORD)0x00000001)|((DWORD)0x80000000)))
      |                                                   ^      ~~~~~~~~~~
.\wakeful.hpp(51,71): error: use of old-style cast [-Werror,-Wold-style-cast]
   51 |  wakeful():PreviousState(SetThreadExecutionState(((DWORD)0x00000001)|((DWORD)0x80000000)))
      |                                                                       ^      ~~~~~~~~~~

clang: /root/llvm-project/clang/lib/Sema/SemaOverload.cpp:12341:
void CompleteNonViableCandidate(clang::Sema&, clang::OverloadCandidate*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet::CandidateSetKind):
Assertion `ArgIdx < Args.size() && "no argument for this arg conversion"' failed.

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-assertions-18.1.0/bin/clang -cc1 -triple x86_64-pc-windows-msvc19.40.33721 -emit-obj -mincremental-linker-compatible -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name editor.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=none -relaxed-aliasing -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -mllvm -x86-asm-syntax=intel -tune-cpu generic -D_MT -flto-visibility-public-std --dependent-lib=libcmt --dependent-lib=oldnames -stack-protector 2 -fcxx-exceptions -fexceptions -fexternc-nounwind -fdiagnostics-format msvc -gno-column-info -gcodeview -debug-info-kind=constructor -D NOMINMAX -D WIN32_LEAN_AND_MEAN -D VC_EXTRALEAN -D PSAPI_VERSION=1 -D _CRT_SECURE_NO_WARNINGS -D UNICODE -D _UNICODE -D NDEBUG -D _ENABLE_EXTENDED_ALIGNED_STORAGE -D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1 -D MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS=1 -O2 -Weverything -Weverything -Werror=array-bounds -Werror=dangling -Werror=odr -Werror=return-type -Werror=old-style-cast -Werror=reorder -fdeprecated-macro -ferror-limit 19 -fmessage-length=211 -fvisibility=hidden -fno-signed-char -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.40.33721 -std=c++26 -fno-implicit-modules -fskip-odr-check-in-gmf -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -Wno-gnu-line-marker -x c++ editor-3a6424.cpp
1.      editor.cpp:444:43: current parser token ')'
2.      editor.cpp:414:1: parsing function body 'Editor::BlockEnd2NumLine'
3.      editor.cpp:414:1: in compound statement ('{}')
4.      editor.cpp:418:2: in compound statement ('{}')
5.      editor.cpp:433:3: in compound statement ('{}')
6.      editor.cpp:435:4: in compound statement ('{}')
7.      editor.cpp:443:5: in compound statement ('{}')
8.      C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.40.33721\include\xutility:1591:31: instantiating function definition 'std::next<Editor::numbered_iterator_t<std::_List_iterator<std::_List_val<std::_List_simple_types<Edit>>>, std::_List_const_iterator<std::_List_val<std::_List_simple_types<Edit>>>>>'
9.      C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.40.33721\include\xutility:1206:23: instantiating variable definition 'std::_Is_ranges_input_iter_v<Editor::numbered_iterator_t<std::_List_iterator<std::_List_val<std::_List_simple_types<Edit>>>, std::_List_const_iterator<std::_List_val<std::_List_simple_types<Edit>>>>>'
  #0 0x00000000038d53d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x38d53d8)
  #1 0x00000000038d2b2c SignalHandler(int) Signals.cpp:0:0
  #2 0x00007fbc954591a0 (/lib/x86_64-linux-gnu/libc.so.6+0x3d1a0)
  #3 0x00007fbc954a70ec (/lib/x86_64-linux-gnu/libc.so.6+0x8b0ec)
  #4 0x00007fbc95459102 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x3d102)
  #5 0x00007fbc954424f2 abort (/lib/x86_64-linux-gnu/libc.so.6+0x264f2)
  #6 0x00007fbc95442415 (/lib/x86_64-linux-gnu/libc.so.6+0x26415)
  #7 0x00007fbc95451d32 (/lib/x86_64-linux-gnu/libc.so.6+0x35d32)
  #8 0x0000000006a10d94 clang::OverloadCandidateSet::CompleteCandidates(clang::Sema&, clang::OverloadCandidateDisplayKind, llvm::ArrayRef<clang::Expr*>, clang::SourceLocation, llvm::function_ref<bool (clang::OverloadCandidate&)>) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6a10d94)
  #9 0x0000000006a13157 clang::OverloadCandidateSet::NoteCandidates(std::pair<clang::SourceLocation, clang::PartialDiagnostic>, clang::Sema&, clang::OverloadCandidateDisplayKind, llvm::ArrayRef<clang::Expr*>, llvm::StringRef, clang::SourceLocation, llvm::function_ref<bool (clang::OverloadCandidate&)>) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6a13157)
 #10 0x0000000006a184a9 clang::Sema::CreateOverloadedUnaryOp(clang::SourceLocation, clang::UnaryOperatorKind, clang::UnresolvedSetImpl const&, clang::Expr*, bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6a184a9)
 #11 0x00000000066a093b clang::Sema::BuildUnaryOp(clang::Scope*, clang::SourceLocation, clang::UnaryOperatorKind, clang::Expr*, bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x66a093b)
 #12 0x0000000006c297d7 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #13 0x0000000006c52f76 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformRequiresExpr(clang::RequiresExpr*) SemaTemplateInstantiate.cpp:0:0
 #14 0x0000000006c54b5e (anonymous namespace)::TemplateInstantiator::TransformRequiresExpr(clang::RequiresExpr*) SemaTemplateInstantiate.cpp:0:0
 #15 0x0000000006c29759 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #16 0x0000000006c5d2d4 clang::Sema::SubstConstraintExpr(clang::Expr*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6c5d2d4)
 #17 0x00000000063af083 calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)::operator()(clang::Expr const*) const SemaConcept.cpp:0:0
 #18 0x00000000063b0b5b clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)&&) SemaConcept.cpp:0:0
 #19 0x00000000063b0aec clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)&&) SemaConcept.cpp:0:0
 #20 0x00000000063b13b2 CheckConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) SemaConcept.cpp:0:0
 #21 0x00000000063b19ea clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x63b19ea)
 #22 0x0000000006ad4d31 clang::Sema::CheckConceptTemplateId(clang::CXXScopeSpec const&, clang::SourceLocation, clang::DeclarationNameInfo const&, clang::NamedDecl*, clang::ConceptDecl*, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6ad4d31)
 #23 0x0000000006c46090 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformConceptSpecializationExpr(clang::ConceptSpecializationExpr*) SemaTemplateInstantiate.cpp:0:0
 #24 0x0000000006c29329 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #25 0x0000000006c5d2d4 clang::Sema::SubstConstraintExpr(clang::Expr*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6c5d2d4)
 #26 0x00000000063af083 calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)::operator()(clang::Expr const*) const SemaConcept.cpp:0:0
 #27 0x00000000063b0b5b clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)&&) SemaConcept.cpp:0:0
 #28 0x00000000063b0aec clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)&&) SemaConcept.cpp:0:0
 #29 0x00000000063b13b2 CheckConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) SemaConcept.cpp:0:0
 #30 0x00000000063b19ea clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x63b19ea)
 #31 0x0000000006ad4d31 clang::Sema::CheckConceptTemplateId(clang::CXXScopeSpec const&, clang::SourceLocation, clang::DeclarationNameInfo const&, clang::NamedDecl*, clang::ConceptDecl*, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6ad4d31)
 #32 0x0000000006c46090 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformConceptSpecializationExpr(clang::ConceptSpecializationExpr*) SemaTemplateInstantiate.cpp:0:0
 #33 0x0000000006c29329 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #34 0x0000000006c5d2d4 clang::Sema::SubstConstraintExpr(clang::Expr*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6c5d2d4)
 #35 0x00000000063af083 calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)::operator()(clang::Expr const*) const SemaConcept.cpp:0:0
 #36 0x00000000063b02eb clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)&>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)&) SemaConcept.cpp:0:0
 #37 0x00000000063b024a clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)&>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)&) SemaConcept.cpp:0:0
 #38 0x00000000063b024a clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)&>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)&) SemaConcept.cpp:0:0
 #39 0x00000000063b0aba clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::'lambda'(clang::Expr const*)&&) SemaConcept.cpp:0:0
 #40 0x00000000063b13b2 CheckConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) SemaConcept.cpp:0:0
 #41 0x00000000063b19ea clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x63b19ea)
 #42 0x0000000006ad4d31 clang::Sema::CheckConceptTemplateId(clang::CXXScopeSpec const&, clang::SourceLocation, clang::DeclarationNameInfo const&, clang::NamedDecl*, clang::ConceptDecl*, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6ad4d31)
 #43 0x0000000006c46090 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformConceptSpecializationExpr(clang::ConceptSpecializationExpr*) SemaTemplateInstantiate.cpp:0:0
 #44 0x0000000006c29329 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #45 0x0000000006c36928 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformBinaryOperator(clang::BinaryOperator*) SemaTemplateInstantiate.cpp:0:0
 #46 0x0000000006c290f9 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #47 0x0000000006c31548 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformParenExpr(clang::ParenExpr*) SemaTemplateInstantiate.cpp:0:0
 #48 0x0000000006c296f7 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #49 0x0000000006c36928 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformBinaryOperator(clang::BinaryOperator*) SemaTemplateInstantiate.cpp:0:0
 #50 0x0000000006c290f9 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #51 0x0000000006c2af58 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformInitializer(clang::Expr*, bool) (.part.0) SemaTemplateInstantiate.cpp:0:0
 #52 0x0000000006c2b4e1 clang::Sema::SubstInitializer(clang::Expr*, clang::MultiLevelTemplateArgumentList const&, bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6c2b4e1)
 #53 0x0000000006c72234 clang::Sema::InstantiateVariableInitializer(clang::VarDecl*, clang::VarDecl*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6c72234)
 #54 0x0000000006c7264e clang::Sema::CompleteVarTemplateSpecializationDecl(clang::VarTemplateSpecializationDecl*, clang::VarDecl*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6c7264e)
 #55 0x0000000006cb40be clang::Sema::InstantiateVariableDefinition(clang::SourceLocation, clang::VarDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6cb40be)
 #56 0x0000000006251ba1 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6251ba1)
 #57 0x000000000665ae12 DoMarkVarDeclReferenced(clang::Sema&, clang::SourceLocation, clang::VarDecl*, clang::Expr*, llvm::DenseMap<clang::VarDecl const*, int, llvm::DenseMapInfo<clang::VarDecl const*, void>, llvm::detail::DenseMapPair<clang::VarDecl const*, int>>&) SemaExpr.cpp:0:0
 #58 0x0000000006686731 MarkExprReferenced(clang::Sema&, clang::SourceLocation, clang::Decl*, clang::Expr*, bool, llvm::DenseMap<clang::VarDecl const*, int, llvm::DenseMapInfo<clang::VarDecl const*, void>, llvm::detail::DenseMapPair<clang::VarDecl const*, int>>&) SemaExpr.cpp:0:0
 #59 0x0000000006686d56 clang::Sema::BuildDeclRefExpr(clang::ValueDecl*, clang::QualType, clang::ExprValueKind, clang::DeclarationNameInfo const&, clang::NestedNameSpecifierLoc, clang::NamedDecl*, clang::SourceLocation, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6686d56)
 #60 0x000000000668754c clang::Sema::BuildDeclRefExpr(clang::ValueDecl*, clang::QualType, clang::ExprValueKind, clang::DeclarationNameInfo const&, clang::CXXScopeSpec const*, clang::NamedDecl*, clang::SourceLocation, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x668754c)
 #61 0x000000000668c721 clang::Sema::BuildDeclarationNameExpr(clang::CXXScopeSpec const&, clang::DeclarationNameInfo const&, clang::NamedDecl*, clang::NamedDecl*, clang::TemplateArgumentListInfo const*, bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x668c721)
 #62 0x0000000006ad5c34 clang::Sema::CheckVarTemplateId(clang::CXXScopeSpec const&, clang::DeclarationNameInfo const&, clang::VarTemplateDecl*, clang::SourceLocation, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6ad5c34)
 #63 0x0000000006adb114 clang::Sema::BuildTemplateIdExpr(clang::CXXScopeSpec const&, clang::SourceLocation, clang::LookupResult&, bool, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6adb114)
 #64 0x0000000006c4a829 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformUnresolvedLookupExpr(clang::UnresolvedLookupExpr*) SemaTemplateInstantiate.cpp:0:0
 #65 0x0000000006c296d9 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
 #66 0x0000000006c5ea94 clang::Sema::SubstExpr(clang::Expr*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6c5ea94)
 #67 0x0000000006c6ea8e clang::TemplateDeclInstantiator::VisitStaticAssertDecl(clang::StaticAssertDecl*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6c6ea8e)
 #68 0x0000000006cc0e84 void llvm::function_ref<void ()>::callback_fn<clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&)::'lambda'()>(long) SemaTemplateInstantiateDecl.cpp:0:0
 #69 0x0000000006251ba1 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6251ba1)
 #70 0x0000000006c7014a clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6c7014a)
 #71 0x0000000006c22e05 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformDeclStmt(clang::DeclStmt*) SemaTemplateInstantiate.cpp:0:0
 #72 0x0000000006c5fac4 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
 #73 0x0000000006c65f4a clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6c65f4a)
 #74 0x0000000006cb6486 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6cb6486)
 #75 0x000000000668efb9 void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::'lambda'()>(long) SemaExpr.cpp:0:0
 #76 0x0000000006251ba1 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6251ba1)
 #77 0x0000000006686254 clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6686254)
 #78 0x00000000066867bd MarkExprReferenced(clang::Sema&, clang::SourceLocation, clang::Decl*, clang::Expr*, bool, llvm::DenseMap<clang::VarDecl const*, int, llvm::DenseMapInfo<clang::VarDecl const*, void>, llvm::detail::DenseMapPair<clang::VarDecl const*, int>>&) SemaExpr.cpp:0:0
 #79 0x0000000006686d56 clang::Sema::BuildDeclRefExpr(clang::ValueDecl*, clang::QualType, clang::ExprValueKind, clang::DeclarationNameInfo const&, clang::NestedNameSpecifierLoc, clang::NamedDecl*, clang::SourceLocation, clang::TemplateArgumentListInfo const*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6686d56)
 #80 0x00000000069e6c64 clang::Sema::FixOverloadedFunctionReference(clang::Expr*, clang::DeclAccessPair, clang::FunctionDecl*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x69e6c64)
 #81 0x0000000006a13977 FinishOverloadedCallExpr(clang::Sema&, clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, clang::OverloadCandidateSet*, clang::OverloadCandidate**, clang::OverloadingResult, bool) SemaOverload.cpp:0:0
 #82 0x0000000006a148b6 clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6a148b6)
 #83 0x00000000066b5049 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x66b5049)
 #84 0x00000000066b6f3c clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x66b6f3c)
 #85 0x000000000616d065 clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*, true>) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x616d065)
 #86 0x0000000006164731 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6164731)
 #87 0x0000000006165c2d clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6165c2d)
 #88 0x000000000616795a clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x616795a)
 #89 0x0000000006167af9 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6167af9)
 #90 0x0000000006127c2d clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6127c2d)
 #91 0x00000000061354a9 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61354a9)
 #92 0x000000000613d785 clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x613d785)
 #93 0x000000000613dc27 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x613dc27)
 #94 0x00000000061de33c clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61de33c)
 #95 0x00000000061df5f7 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61df5f7)
 #96 0x00000000061e0519 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e0519)
 #97 0x00000000061e0bb4 clang::Parser::ParseCompoundStatement(bool, unsigned int) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e0bb4)
 #98 0x00000000061dd7bf clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61dd7bf)
 #99 0x00000000061df5f7 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61df5f7)
#100 0x00000000061e1fc8 clang::Parser::ParseStatement(clang::SourceLocation*, clang::Parser::ParsedStmtContext) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e1fc8)
#101 0x00000000061e463f clang::Parser::ParseIfStatement(clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e463f)
#102 0x00000000061de0ad clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61de0ad)
#103 0x00000000061df5f7 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61df5f7)
#104 0x00000000061e0519 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e0519)
#105 0x00000000061e0bb4 clang::Parser::ParseCompoundStatement(bool, unsigned int) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e0bb4)
#106 0x00000000061dd7bf clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61dd7bf)
#107 0x00000000061df5f7 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61df5f7)
#108 0x00000000061e1fc8 clang::Parser::ParseStatement(clang::SourceLocation*, clang::Parser::ParsedStmtContext) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e1fc8)
#109 0x00000000061e3c7d clang::Parser::ParseWhileStatement(clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e3c7d)
#110 0x00000000061de076 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61de076)
#111 0x00000000061df5f7 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61df5f7)
#112 0x00000000061e0519 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e0519)
#113 0x00000000061e0bb4 clang::Parser::ParseCompoundStatement(bool, unsigned int) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e0bb4)
#114 0x00000000061dd7bf clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61dd7bf)
#115 0x00000000061df5f7 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61df5f7)
#116 0x00000000061e1fc8 clang::Parser::ParseStatement(clang::SourceLocation*, clang::Parser::ParsedStmtContext) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e1fc8)
#117 0x00000000061e4772 clang::Parser::ParseIfStatement(clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e4772)
#118 0x00000000061de0ad clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61de0ad)
#119 0x00000000061df5f7 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61df5f7)
#120 0x00000000061e0519 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e0519)
#121 0x00000000061e0bb4 clang::Parser::ParseCompoundStatement(bool, unsigned int) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e0bb4)
#122 0x00000000061dd7bf clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61dd7bf)
#123 0x00000000061df5f7 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61df5f7)
#124 0x00000000061e1fc8 clang::Parser::ParseStatement(clang::SourceLocation*, clang::Parser::ParsedStmtContext) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e1fc8)
#125 0x00000000061e463f clang::Parser::ParseIfStatement(clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e463f)
#126 0x00000000061de0ad clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61de0ad)
#127 0x00000000061df5f7 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61df5f7)
#128 0x00000000061e0519 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e0519)
#129 0x00000000061e1e3a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x61e1e3a)
#130 0x0000000006100951 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6100951)
#131 0x0000000006135b11 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x6135b11)
#132 0x00000000060f4adb clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x60f4adb)
#133 0x00000000060f5261 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x60f5261)
#134 0x00000000060fc516 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x60fc516)
#135 0x00000000060fd3bd clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x60fd3bd)
#136 0x00000000060f02ea clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x60f02ea)
#137 0x000000000415d928 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x415d928)
#138 0x00000000043cbfe9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x43cbfe9)
#139 0x000000000434ba9e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x434ba9e)
#140 0x00000000044ab01e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0x44ab01e)
#141 0x0000000000c10cd6 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0xc10cd6)
#142 0x0000000000c084fa ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#143 0x0000000000c0d844 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0xc0d844)
#144 0x0000000000b05134 main (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0xb05134)
#145 0x00007fbc95443b8a (/lib/x86_64-linux-gnu/libc.so.6+0x27b8a)
#146 0x00007fbc95443c45 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x27c45)
#147 0x0000000000c07fde _start (/opt/compiler-explorer/clang-assertions-18.1.0/bin/clang+0xc07fde)
Aborted
Endilll commented 4 months ago

Confirmed on Clang 19.0 (trunk): https://godbolt.org/z/bqqnvc5Gb Reduced by me and C-Reduce:

class numbered_iterator {
  void operator++(int) = delete;
};

template <typename InIt>
void next() {
  static_assert(requires(InIt i) { i++; }, "next requires input iterator");
}

enum struct lng : int;

void operator++(lng &, int);

void ShowEditor() {
  next<numbered_iterator>();
}

Stack trace:

clang++: /root/llvm-project/clang/lib/Sema/SemaOverload.cpp:12599:
void CompleteNonViableCandidate(clang::Sema&, clang::OverloadCandidate*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet::CandidateSetKind):
Assertion `ArgIdx < Args.size() && "no argument for this arg conversion"' failed.

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -std=c++20 -ferror-limit=0 <source>
1.  <eof> parser at end of file
2.  <source>:6:6: instantiating function definition 'next<numbered_iterator>'
 #0 0x0000000003979e88 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3979e88)
 #1 0x0000000003977b6c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3977b6c)
 #2 0x00000000038c9528 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007b36a9242520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007b36a92969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007b36a9242476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007b36a92287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x00007b36a922871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x00007b36a9239e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x0000000006c162f4 clang::OverloadCandidateSet::CompleteCandidates(clang::Sema&, clang::OverloadCandidateDisplayKind, llvm::ArrayRef<clang::Expr*>, clang::SourceLocation, llvm::function_ref<bool (clang::OverloadCandidate&)>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6c162f4)
#10 0x0000000006c1889e clang::OverloadCandidateSet::NoteCandidates(std::pair<clang::SourceLocation, clang::PartialDiagnostic>, clang::Sema&, clang::OverloadCandidateDisplayKind, llvm::ArrayRef<clang::Expr*>, llvm::StringRef, clang::SourceLocation, llvm::function_ref<bool (clang::OverloadCandidate&)>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6c1889e)
#11 0x0000000006c1df63 clang::Sema::CreateOverloadedUnaryOp(clang::SourceLocation, clang::UnaryOperatorKind, clang::UnresolvedSetImpl const&, clang::Expr*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6c1df63)
#12 0x000000000685d8fe clang::Sema::BuildUnaryOp(clang::Scope*, clang::SourceLocation, clang::UnaryOperatorKind, clang::Expr*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x685d8fe)
#13 0x0000000006e64c97 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
#14 0x0000000006e905de clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformRequiresExpr(clang::RequiresExpr*) SemaTemplateInstantiate.cpp:0:0
#15 0x0000000006e9240e (anonymous namespace)::TemplateInstantiator::TransformRequiresExpr(clang::RequiresExpr*) SemaTemplateInstantiate.cpp:0:0
#16 0x0000000006e64c19 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) SemaTemplateInstantiate.cpp:0:0
#17 0x0000000006e9c5a4 clang::Sema::SubstExpr(clang::Expr*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6e9c5a4)
#18 0x0000000006eaf48e clang::TemplateDeclInstantiator::VisitStaticAssertDecl(clang::StaticAssertDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6eaf48e)
#19 0x0000000006f08044 void llvm::function_ref<void ()>::callback_fn<clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&)::'lambda'()>(long) SemaTemplateInstantiateDecl.cpp:0:0
#20 0x00000000063f3e31 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x63f3e31)
#21 0x0000000006eb0c3a clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6eb0c3a)
#22 0x0000000006e5dd85 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformDeclStmt(clang::DeclStmt*) SemaTemplateInstantiate.cpp:0:0
#23 0x0000000006e9f844 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) SemaTemplateInstantiate.cpp:0:0
#24 0x0000000006ea6bfa clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ea6bfa)
#25 0x0000000006efd1b8 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6efd1b8)
#26 0x0000000006efb47f clang::Sema::PerformPendingInstantiations(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6efb47f)
#27 0x000000000641662f clang::Sema::ActOnEndOfTranslationUnitFragment(clang::Sema::TUFragmentKind) (.part.0) Sema.cpp:0:0
#28 0x0000000006416e1a clang::Sema::ActOnEndOfTranslationUnit() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6416e1a)
#29 0x000000000629129a clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x629129a)
#30 0x0000000006284c7a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6284c7a)
#31 0x0000000004247228 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4247228)
#32 0x00000000044c85b9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x44c85b9)
#33 0x000000000445067e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x445067e)
#34 0x00000000045af39e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x45af39e)
#35 0x0000000000c4fcec cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc4fcec)
#36 0x0000000000c48f7a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#37 0x000000000428aa69 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#38 0x00000000038c99d4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x38c99d4)
#39 0x000000000428b05f clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#40 0x00000000042513f5 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x42513f5)
#41 0x0000000004251e5d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4251e5d)
#42 0x0000000004259be5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4259be5)
#43 0x0000000000c4d185 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc4d185)
#44 0x0000000000b2f254 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xb2f254)
#45 0x00007b36a9229d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#46 0x00007b36a9229e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#47 0x0000000000c48a6e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc48a6e)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
llvmbot commented 4 months ago

@llvm/issue-subscribers-c-20

Author: Alex Alabuzhev (alabuzhev)

See the attached [Access_violation_Is_ranges_input_iter_v.zip](https://github.com/llvm/llvm-project/files/14960942/Access_violation_Is_ranges_input_iter_v.zip) It works fine with this change (lines 354266-354267): ```DIFF - numbered_iterator_t operator++(int) = delete; - numbered_iterator_t operator--(int) = delete; + auto operator++(int) { auto Copy = *this; ++*this; return Copy; } + auto operator--(int) { auto Copy = *this; --*this; return Copy; } ``` I guess without postifx forms the type doesn't model `std::weakly_incrementable` properly, but it's probably not a reason to crash.