[llvm-bugs] [Bug 41977] New: ICE on lambda trailing return type with variadic arguments

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 22 02:50:55 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41977

            Bug ID: 41977
           Summary: ICE on lambda trailing return type with variadic
                    arguments
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: filip.hausman at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Stack dump:
0.      Program arguments:
/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9 -cc1 -triple
x86_64-unknown-linux-gnu -S -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name example.cpp -mrelocation-model static
-mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb
-momit-leaf-frame-pointer -coverage-notes-file /home/ubuntu/./output.gcno
-resource-dir /opt/compiler-explorer/clang-trunk-20190522/lib/clang/9.0.0
-internal-isystem
/opt/compiler-explorer/gcc-8.3.0/lib/gcc/x86_64-linux-gnu/8.3.0/../../../../include/c++/8.3.0
-internal-isystem
/opt/compiler-explorer/gcc-8.3.0/lib/gcc/x86_64-linux-gnu/8.3.0/../../../../include/c++/8.3.0/x86_64-linux-gnu
-internal-isystem
/opt/compiler-explorer/gcc-8.3.0/lib/gcc/x86_64-linux-gnu/8.3.0/../../../../include/c++/8.3.0/backward
-internal-isystem /usr/local/include -internal-isystem
/opt/compiler-explorer/clang-trunk-20190522/lib/clang/9.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-std=c++17 -fdeprecated-macro -fdebug-compilation-dir /home/ubuntu
-ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops
-vectorize-slp -mllvm --x86-asm-syntax=intel -o ./output.s -x c++ <source>
-faddrsig 

1.      <source>:107:23: current parser token '=='

2.      <source>:95:1: parsing function body 'main'

3.      <source>:95:1: in compound statement ('{}')

4.      <source>:33:20: instantiating function definition 'la::vec<int,
3>::operator*<int, void>'

5.     
/opt/compiler-explorer/gcc-8.3.0/lib/gcc/x86_64-linux-gnu/8.3.0/../../../../include/c++/8.3.0/tuple:1684:5:
instantiating function definition 'std::apply<(lambda at <source>:36:13), const
std::array<int, 3> &>'

6.     
/opt/compiler-explorer/gcc-8.3.0/lib/gcc/x86_64-linux-gnu/8.3.0/../../../../include/c++/8.3.0/tuple:1676:5:
instantiating function definition 'std::__apply_impl<(lambda at
<source>:36:13), const std::array<int, 3> &, 0, 1, 2>'

7.     
/opt/compiler-explorer/gcc-8.3.0/lib/gcc/x86_64-linux-gnu/8.3.0/../../../../include/c++/8.3.0/type_traits:2299:12:
instantiating class definition 'std::__invoke_result<(lambda at
<source>:36:13), const int &, const int &, const int &>'

8.     
/opt/compiler-explorer/gcc-8.3.0/lib/gcc/x86_64-linux-gnu/8.3.0/../../../../include/c++/8.3.0/type_traits:2261:12:
instantiating class definition 'std::__result_of_impl<false, false, (lambda at
<source>:36:13), const int &, const int &, const int &>'

  #0 0x000055f977f6592a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x269e92a)

  #1 0x000055f977f636f4 llvm::sys::RunSignalHandlers()
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x269c6f4)

  #2 0x000055f977f63832 SignalHandler(int)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x269c832)

  #3 0x00007fe5720ad890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)

  #4 0x000055f979796c6b clang::Sema::tryCaptureVariable(clang::VarDecl*,
clang::SourceLocation, clang::Sema::TryCaptureKind, clang::SourceLocation,
bool, clang::QualType&, clang::QualType&, unsigned int const*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3ecfc6b)

  #5 0x000055f9797999d1 clang::Sema::NeedToCaptureVariable(clang::VarDecl*,
clang::SourceLocation)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3ed29d1)

  #6 0x000055f97979b390 clang::Sema::BuildDeclRefExpr(clang::ValueDecl*,
clang::QualType, clang::ExprValueKind, clang::DeclarationNameInfo const&,
clang::CXXScopeSpec const*, clang::NamedDecl*, clang::TemplateArgumentListInfo
const*) (/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3ed4390)

  #7 0x000055f97979b9ef
clang::Sema::BuildDeclarationNameExpr(clang::CXXScopeSpec const&,
clang::DeclarationNameInfo const&, clang::NamedDecl*, clang::NamedDecl*,
clang::TemplateArgumentListInfo const*, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3ed49ef)

  #8 0x000055f979a87d41 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformDeclRefExpr(clang::DeclRefExpr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41c0d41)

  #9 0x000055f979a722f2 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41ab2f2)

 #10 0x000055f979a74ae9 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformBinaryOperator(clang::BinaryOperator*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41adae9)

 #11 0x000055f979a721ab clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41ab1ab)

 #12 0x000055f979a79ee5 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&,
clang::TypeLoc)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b2ee5)

 #13 0x000055f979a7d021 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b6021)

 #14 0x000055f979a7f3cb clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformTemplateArgument(clang::TemplateArgumentLoc
const&, clang::TemplateArgumentLoc&, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b83cb)

 #15 0x000055f979a824bb clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&,
clang::TemplateSpecializationTypeLoc, clang::TemplateName)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41bb4bb)

 #16 0x000055f979a7e9c4 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformTSIInObjectScope(clang::TypeLoc,
clang::QualType, clang::NamedDecl*, clang::CXXScopeSpec&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b79c4)

 #17 0x000055f979a7ee88 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformNestedNameSpecifierLoc(clang::NestedNameSpecifierLoc,
clang::QualType, clang::NamedDecl*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b7e88)

 #18 0x000055f979a82e9f clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformDependentNameType(clang::TypeLocBuilder&,
clang::DependentNameTypeLoc, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41bbe9f)

 #19 0x000055f979a7a308 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&,
clang::TypeLoc)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b3308)

 #20 0x000055f979a7d021 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b6021)

 #21 0x000055f979a7f3cb clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformTemplateArgument(clang::TemplateArgumentLoc
const&, clang::TemplateArgumentLoc&, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b83cb)

 #22 0x000055f979a825d0 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&,
clang::TemplateSpecializationTypeLoc, clang::TemplateName)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41bb5d0)

 #23 0x000055f979a7b140 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&,
clang::TypeLoc)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b4140)

 #24 0x000055f979a8bbd1
clang::Sema::SubstFunctionDeclType(clang::TypeSourceInfo*,
clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation,
clang::DeclarationName, clang::CXXRecordDecl*, clang::Qualifiers)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41c4bd1)

 #25 0x000055f979a9a914
clang::TemplateDeclInstantiator::SubstFunctionType(clang::FunctionDecl*,
llvm::SmallVectorImpl<clang::ParmVarDecl*>&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41d3914)

 #26 0x000055f979aabd97
clang::TemplateDeclInstantiator::VisitCXXMethodDecl(clang::CXXMethodDecl*,
clang::TemplateParameterList*,
llvm::Optional<clang::ASTTemplateArgumentListInfo const*>)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41e4d97)

 #27 0x000055f979aa8dfd clang::Sema::SubstDecl(clang::Decl*,
clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41e1dfd)

 #28 0x000055f979a607f2
clang::Sema::FinishTemplateArgumentDeduction(clang::FunctionTemplateDecl*,
llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int,
clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&,
llvm::SmallVectorImpl<clang::Sema::OriginalCallArg> const*, bool,
llvm::function_ref<bool ()>)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41997f2)

 #29 0x000055f979a65229
clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*,
clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>,
clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool,
llvm::function_ref<bool (llvm::ArrayRef<clang::QualType>)>)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x419e229)

 #30 0x000055f97994cf6b
clang::Sema::AddMethodTemplateCandidate(clang::FunctionTemplateDecl*,
clang::DeclAccessPair, clang::CXXRecordDecl*, clang::TemplateArgumentListInfo*,
clang::QualType, clang::Expr::Classification, llvm::ArrayRef<clang::Expr*>,
clang::OverloadCandidateSet&, bool, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x4085f6b)

 #31 0x000055f97994d2d1 clang::Sema::AddMethodCandidate(clang::DeclAccessPair,
clang::QualType, clang::Expr::Classification, llvm::ArrayRef<clang::Expr*>,
clang::OverloadCandidateSet&, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x40862d1)

 #32 0x000055f97995d4a8
clang::Sema::BuildCallToObjectOfClassType(clang::Scope*, clang::Expr*,
clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>,
clang::SourceLocation)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x40964a8)

 #33 0x000055f9797a46a0 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*,
clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>,
clang::SourceLocation, clang::Expr*, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3edd6a0)

 #34 0x000055f979a77a74 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b0a74)

 #35 0x000055f979a721fb clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41ab1fb)

 #36 0x000055f979a79ee5 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&,
clang::TypeLoc)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b2ee5)

 #37 0x000055f979a7d021 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b6021)

 #38 0x000055f979a7f3cb clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformTemplateArgument(clang::TemplateArgumentLoc
const&, clang::TemplateArgumentLoc&, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b83cb)

 #39 0x000055f979a825d0 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&,
clang::TemplateSpecializationTypeLoc, clang::TemplateName)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41bb5d0)

 #40 0x000055f979a7b140 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&,
clang::TypeLoc)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b4140)

 #41 0x000055f979a8b7d8
clang::Sema::SubstFunctionDeclType(clang::TypeSourceInfo*,
clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation,
clang::DeclarationName, clang::CXXRecordDecl*, clang::Qualifiers)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41c47d8)

 #42 0x000055f979a9a914
clang::TemplateDeclInstantiator::SubstFunctionType(clang::FunctionDecl*,
llvm::SmallVectorImpl<clang::ParmVarDecl*>&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41d3914)

 #43 0x000055f979aabd97
clang::TemplateDeclInstantiator::VisitCXXMethodDecl(clang::CXXMethodDecl*,
clang::TemplateParameterList*,
llvm::Optional<clang::ASTTemplateArgumentListInfo const*>)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41e4d97)

 #44 0x000055f979aa8dfd clang::Sema::SubstDecl(clang::Decl*,
clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41e1dfd)

 #45 0x000055f979a607f2
clang::Sema::FinishTemplateArgumentDeduction(clang::FunctionTemplateDecl*,
llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int,
clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&,
llvm::SmallVectorImpl<clang::Sema::OriginalCallArg> const*, bool,
llvm::function_ref<bool ()>)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41997f2)

 #46 0x000055f979a65229
clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*,
clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>,
clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool,
llvm::function_ref<bool (llvm::ArrayRef<clang::QualType>)>)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x419e229)

 #47 0x000055f97994e4b8
clang::Sema::AddTemplateOverloadCandidate(clang::FunctionTemplateDecl*,
clang::DeclAccessPair, clang::TemplateArgumentListInfo*,
llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool, bool,
clang::CallExpr::ADLCallKind)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x40874b8)

 #48 0x000055f979950474
clang::Sema::AddOverloadedCallCandidates(clang::UnresolvedLookupExpr*,
llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x4089474)

 #49 0x000055f9799507ea clang::Sema::buildOverloadedCallSet(clang::Scope*,
clang::Expr*, clang::UnresolvedLookupExpr*,
llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation,
clang::OverloadCandidateSet*, clang::ActionResult<clang::Expr*, true>*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x40897ea)

 #50 0x000055f97995a477 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-trunk-20190522/bin/clang-9+0x4093477)

 #51 0x000055f9797a42ac clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*,
clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>,
clang::SourceLocation, clang::Expr*, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3edd2ac)

 #52 0x000055f979a77a74 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b0a74)

 #53 0x000055f979a721fb clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41ab1fb)

 #54 0x000055f979a79ee5 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&,
clang::TypeLoc)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b2ee5)

 #55 0x000055f979a7d021 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b6021)

 #56 0x000055f979a832cf clang::Sema::SubstType(clang::TypeSourceInfo*,
clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation,
clang::DeclarationName, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41bc2cf)

 #57 0x000055f979aa3713
clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(clang::TypedefNameDecl*,
bool) (/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41dc713)

 #58 0x000055f979aa3c4f
clang::TemplateDeclInstantiator::VisitTypedefDecl(clang::TypedefDecl*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41dcc4f)

 #59 0x000055f979a843e1 clang::Sema::InstantiateClass(clang::SourceLocation,
clang::CXXRecordDecl*, clang::CXXRecordDecl*,
clang::MultiLevelTemplateArgumentList const&,
clang::TemplateSpecializationKind, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41bd3e1)

 #60 0x000055f979a9773f
clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation,
clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind,
bool) (/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41d073f)

 #61 0x000055f979ad5a3d
clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType,
clang::Sema::TypeDiagnoser*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x420ea3d)

 #62 0x000055f979ad5cb5 clang::Sema::RequireCompleteType(clang::SourceLocation,
clang::QualType, clang::Sema::TypeDiagnoser&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x420ecb5)

 #63 0x000055f97955c97e
clang::Sema::RequireCompleteDeclContext(clang::CXXScopeSpec&,
clang::DeclContext*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3c9597e)

 #64 0x000055f9799c3999
clang::Sema::CheckTypenameType(clang::ElaboratedTypeKeyword,
clang::SourceLocation, clang::NestedNameSpecifierLoc, clang::IdentifierInfo
const&, clang::SourceLocation)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x40fc999)

 #65 0x000055f979a6ba58 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::RebuildDependentNameType(clang::ElaboratedTypeKeyword,
clang::SourceLocation, clang::NestedNameSpecifierLoc, clang::IdentifierInfo
const*, clang::SourceLocation, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41a4a58)

 #66 0x000055f979a82ed5 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformDependentNameType(clang::TypeLocBuilder&,
clang::DependentNameTypeLoc, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41bbed5)

 #67 0x000055f979a7a308 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&,
clang::TypeLoc)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b3308)

 #68 0x000055f979a7d021 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b6021)

 #69 0x000055f979a832cf clang::Sema::SubstType(clang::TypeSourceInfo*,
clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation,
clang::DeclarationName, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41bc2cf)

 #70 0x000055f979a835df clang::Sema::SubstBaseSpecifiers(clang::CXXRecordDecl*,
clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41bc5df)

 #71 0x000055f979a84275 clang::Sema::InstantiateClass(clang::SourceLocation,
clang::CXXRecordDecl*, clang::CXXRecordDecl*,
clang::MultiLevelTemplateArgumentList const&,
clang::TemplateSpecializationKind, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41bd275)

 #72 0x000055f979a9773f
clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation,
clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind,
bool) (/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41d073f)

 #73 0x000055f979ad5a3d
clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType,
clang::Sema::TypeDiagnoser*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x420ea3d)

 #74 0x000055f979ad5cb5 clang::Sema::RequireCompleteType(clang::SourceLocation,
clang::QualType, clang::Sema::TypeDiagnoser&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x420ecb5)

 #75 0x000055f97955c97e
clang::Sema::RequireCompleteDeclContext(clang::CXXScopeSpec&,
clang::DeclContext*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3c9597e)

 #76 0x000055f9799c3999
clang::Sema::CheckTypenameType(clang::ElaboratedTypeKeyword,
clang::SourceLocation, clang::NestedNameSpecifierLoc, clang::IdentifierInfo
const&, clang::SourceLocation)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x40fc999)

 #77 0x000055f979a6ba58 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::RebuildDependentNameType(clang::ElaboratedTypeKeyword,
clang::SourceLocation, clang::NestedNameSpecifierLoc, clang::IdentifierInfo
const*, clang::SourceLocation, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41a4a58)

 #78 0x000055f979a82ed5 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformDependentNameType(clang::TypeLocBuilder&,
clang::DependentNameTypeLoc, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41bbed5)

 #79 0x000055f979a7a308 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&,
clang::TypeLoc)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b3308)

 #80 0x000055f979a8b7d8
clang::Sema::SubstFunctionDeclType(clang::TypeSourceInfo*,
clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation,
clang::DeclarationName, clang::CXXRecordDecl*, clang::Qualifiers)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41c47d8)

 #81 0x000055f979a9a914
clang::TemplateDeclInstantiator::SubstFunctionType(clang::FunctionDecl*,
llvm::SmallVectorImpl<clang::ParmVarDecl*>&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41d3914)

 #82 0x000055f979aa74ad
clang::TemplateDeclInstantiator::VisitFunctionDecl(clang::FunctionDecl*,
clang::TemplateParameterList*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41e04ad)

 #83 0x000055f979aa8dfd clang::Sema::SubstDecl(clang::Decl*,
clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41e1dfd)

 #84 0x000055f979a607f2
clang::Sema::FinishTemplateArgumentDeduction(clang::FunctionTemplateDecl*,
llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int,
clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&,
llvm::SmallVectorImpl<clang::Sema::OriginalCallArg> const*, bool,
llvm::function_ref<bool ()>)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41997f2)

 #85 0x000055f979a65229
clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*,
clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>,
clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool,
llvm::function_ref<bool (llvm::ArrayRef<clang::QualType>)>)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x419e229)

 #86 0x000055f97994e4b8
clang::Sema::AddTemplateOverloadCandidate(clang::FunctionTemplateDecl*,
clang::DeclAccessPair, clang::TemplateArgumentListInfo*,
llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool, bool,
clang::CallExpr::ADLCallKind)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x40874b8)

 #87 0x000055f979950474
clang::Sema::AddOverloadedCallCandidates(clang::UnresolvedLookupExpr*,
llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x4089474)

 #88 0x000055f9799507ea clang::Sema::buildOverloadedCallSet(clang::Scope*,
clang::Expr*, clang::UnresolvedLookupExpr*,
llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation,
clang::OverloadCandidateSet*, clang::ActionResult<clang::Expr*, true>*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x40897ea)

 #89 0x000055f97995a477 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-trunk-20190522/bin/clang-9+0x4093477)

 #90 0x000055f9797a42ac clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*,
clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>,
clang::SourceLocation, clang::Expr*, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3edd2ac)

 #91 0x000055f979a77a74 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b0a74)

 #92 0x000055f979a721fb clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41ab1fb)

 #93 0x000055f979a72f9b clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformInitializer(clang::Expr*, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41abf9b)

 #94 0x000055f979a74067 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformReturnStmt(clang::ReturnStmt*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41ad067)

 #95 0x000055f979a96f98 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41cff98)

 #96 0x000055f979a96eca clang::Sema::SubstStmt(clang::Stmt*,
clang::MultiLevelTemplateArgumentList const&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41cfeca)

 #97 0x000055f979aab48c
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41e448c)

 #98 0x000055f979a33c89 clang::Sema::DeduceReturnType(clang::FunctionDecl*,
clang::SourceLocation, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x416cc89)

 #99 0x000055f97977cca1 clang::Sema::DiagnoseUseOfDecl(clang::NamedDecl*,
llvm::ArrayRef<clang::SourceLocation>, clang::ObjCInterfaceDecl const*, bool,
bool, clang::ObjCInterfaceDecl*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3eb5ca1)

#100 0x000055f97995a0d0 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)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x40930d0)

#101 0x000055f97995a4e4 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-trunk-20190522/bin/clang-9+0x40934e4)

#102 0x000055f9797a42ac clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*,
clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>,
clang::SourceLocation, clang::Expr*, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3edd2ac)

#103 0x000055f979a77a74 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b0a74)

#104 0x000055f979a721fb clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41ab1fb)

#105 0x000055f979a72f9b clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformInitializer(clang::Expr*, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41abf9b)

#106 0x000055f979a74067 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformReturnStmt(clang::ReturnStmt*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41ad067)

#107 0x000055f979a96f98 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41cff98)

#108 0x000055f979a96eca clang::Sema::SubstStmt(clang::Stmt*,
clang::MultiLevelTemplateArgumentList const&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41cfeca)

#109 0x000055f979aab48c
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41e448c)

#110 0x000055f979a33c89 clang::Sema::DeduceReturnType(clang::FunctionDecl*,
clang::SourceLocation, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x416cc89)

#111 0x000055f97977cca1 clang::Sema::DiagnoseUseOfDecl(clang::NamedDecl*,
llvm::ArrayRef<clang::SourceLocation>, clang::ObjCInterfaceDecl const*, bool,
bool, clang::ObjCInterfaceDecl*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3eb5ca1)

#112 0x000055f97995a0d0 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)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x40930d0)

#113 0x000055f97995a4e4 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-trunk-20190522/bin/clang-9+0x40934e4)

#114 0x000055f9797a42ac clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*,
clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>,
clang::SourceLocation, clang::Expr*, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3edd2ac)

#115 0x000055f979a77a74 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41b0a74)

#116 0x000055f979a721fb clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41ab1fb)

#117 0x000055f979a72f9b clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformInitializer(clang::Expr*, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41abf9b)

#118 0x000055f979a74067 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformReturnStmt(clang::ReturnStmt*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41ad067)

#119 0x000055f979a96f98 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41cff98)

#120 0x000055f979a96eca clang::Sema::SubstStmt(clang::Stmt*,
clang::MultiLevelTemplateArgumentList const&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41cfeca)

#121 0x000055f979aab48c
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x41e448c)

#122 0x000055f979a33c89 clang::Sema::DeduceReturnType(clang::FunctionDecl*,
clang::SourceLocation, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x416cc89)

#123 0x000055f97977cca1 clang::Sema::DiagnoseUseOfDecl(clang::NamedDecl*,
llvm::ArrayRef<clang::SourceLocation>, clang::ObjCInterfaceDecl const*, bool,
bool, clang::ObjCInterfaceDecl*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3eb5ca1)

#124 0x000055f97992b44f CreateFunctionRefExpr(clang::Sema&,
clang::FunctionDecl*, clang::NamedDecl*, clang::Expr const*, bool,
clang::SourceLocation, clang::DeclarationNameLoc const&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x406444f)

#125 0x000055f97995f1fe
clang::Sema::CreateOverloadedBinOp(clang::SourceLocation,
clang::BinaryOperatorKind, clang::UnresolvedSetImpl const&, clang::Expr*,
clang::Expr*, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x40981fe)

#126 0x000055f97976a20d BuildOverloadedBinOp(clang::Sema&, clang::Scope*,
clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3ea320d)

#127 0x000055f979790ba7 clang::Sema::BuildBinOp(clang::Scope*,
clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3ec9ba7)

#128 0x000055f9797911ef clang::Sema::ActOnBinOp(clang::Scope*,
clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3eca1ef)

#129 0x000055f979487218
clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*,
true>, clang::prec::Level)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3bc0218)

#130 0x000055f97948b3c2
clang::Parser::ParseConstantExpressionInExprEvalContext(clang::Parser::TypeCastState)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3bc43c2)

#131 0x000055f9794715bc
clang::Parser::ParseStaticAssertDeclaration(clang::SourceLocation&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3baa5bc)

#132 0x000055f979468c70
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3ba1c70)

#133 0x000055f9794ceec2
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3c07ec2)

#134 0x000055f9794d04f9
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3c094f9)

#135 0x000055f9794d3b21 clang::Parser::ParseCompoundStatementBody(bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3c0cb21)

#136 0x000055f9794d6be3 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3c0fbe3)

#137 0x000055f979443eb8
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3b7ceb8)

#138 0x000055f9794646d1 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3b9d6d1)

#139 0x000055f97943ee29
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3b77e29)

#140 0x000055f97943fb01
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.207)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3b78b01)

#141 0x000055f979446d56
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3b7fd56)

#142 0x000055f9794477b9
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3b807b9)

#143 0x000055f97943b5c9 clang::ParseAST(clang::Sema&, bool, bool)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x3b745c9)

#144 0x000055f978c8e347 clang::CodeGenAction::ExecuteAction()
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x33c7347)

#145 0x000055f978628d36 clang::FrontendAction::Execute()
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x2d61d36)

#146 0x000055f9785eb91c
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x2d2491c)

#147 0x000055f9786e75c3
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0x2e205c3)

#148 0x000055f976557890 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0xc90890)

#149 0x000055f9764b9eb2 main
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0xbf2eb2)

#150 0x00007fe570f6bb97 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b97)

#151 0x000055f976554e8a _start
(/opt/compiler-explorer/clang-trunk-20190522/bin/clang-9+0xc8de8a)

clang-9: error: unable to execute command: Segmentation fault (core dumped)

clang-9: error: clang frontend command failed due to signal (use -v to see
invocation)

Compiler returned: 254

***********************************************************************

#include <type_traits>
#include <tuple>
#include <array>

namespace la
{
namespace internal
{
template <typename Vec, size_t... I>
constexpr auto dot_impl(Vec const& a, Vec const& b, std::index_sequence<I...>)
{
    return ((std::get<I>(a) * std::get<I>(b)) + ...);
}
}  // namespace internal

template <typename T, size_t Size>
class vec : public std::array<T, Size>
{
   public:
    constexpr static auto size = Size;

    constexpr bool operator==(vec<T, Size> const& o) const
    {
        return equals(o, std::make_index_sequence<size>{});
    }

    constexpr bool operator!=(vec<T, Size> const& o) const
    {
        return !equals(o, std::make_index_sequence<size>{});
    }

    template<typename MultT, typename =
std::enable_if_t<std::is_integral_v<MultT> || std::is_floating_point_v<MultT>>>
    constexpr auto operator*(MultT const mult) const
    {
        return std::apply(
            [&](auto const& ... a) -> vec<typename
std::common_type<decltype(mult*a)...>::type, Size>
                { return {mult*a...}; },
            get());
    }

   private:
    template <size_t... I>
    constexpr bool equals(vec<T, Size> const& o, std::index_sequence<I...>)
const
    {
        return ((std::get<I>(*this) == std::get<I>(o)) && ...);
    }

    constexpr const std::array<T, Size>& get() const { return *this; }
};

template <typename... T>
vec(T&&...)->vec<typename std::common_type<T...>::type, sizeof...(T)>;

using vec2i = vec<int, 2>;
using vec3i = vec<int, 3>;
using vec2f = vec<float, 2>;
using vec3f = vec<float, 3>;

template <typename Vec>
constexpr auto x(Vec const& v)
{
    return std::get<0>(v);
}

template <typename Vec>
constexpr auto y(Vec const& v)
{
    return std::get<1>(v);
}

template <typename Vec>
constexpr auto z(Vec const& v)
{
    return std::get<2>(v);
}

template <typename Vec>
constexpr auto dot(Vec const& a, Vec const& b)
{
    return internal::dot_impl(a, b, std::make_index_sequence<Vec::size>{});
}

template <typename Vec>
constexpr auto cross(Vec const& a, Vec const& b)
{
    return Vec{y(a) * z(b) - z(a) * y(b),
        z(a) * x(b) - x(a) * z(b),
        x(a) * y(b) - y(a) * x(b)};
}
}  // namespace la

using namespace la;

int main()
{
    constexpr vec a{1,2,3};
    constexpr vec b{3,4,5};

    static_assert(x(a) == 1);
    static_assert(y(a) == 2);
    static_assert(z(a) == 3);
    static_assert((a == b) == false);
    static_assert((a != b) == true);
    static_assert(dot(a, b) == 26);
    static_assert(cross(a, b) == vec{-2, 4, -2});
    static_assert(cross(b, a) == vec{2, -4, 2});
    static_assert(a*2 == vec{2,4,6});

    return 0;
}

https://godbolt.org/z/SClrK5

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190522/0872890e/attachment-0001.html>


More information about the llvm-bugs mailing list