[llvm-bugs] [Bug 33471] New: Crash with 'operator auto'

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 15 10:44:52 PDT 2017


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

            Bug ID: 33471
           Summary: Crash with 'operator auto'
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Keywords: crash-on-invalid
          Severity: enhancement
          Priority: P
         Component: C++14
          Assignee: unassignedclangbugs at nondot.org
          Reporter: v.reichelt at netcologne.de
                CC: llvm-bugs at lists.llvm.org

The following invalid code snippet (compiled with -std=c++1y)
triggers a compiler error since at least LLVM-3.4:

=========================================================================
template<int> struct A
{
  template<typename T> operator T();
};

void foo()
{
  A<0>().operator auto();
}
=========================================================================

=========================================================================
undeduced type in IR-generation
UNREACHABLE executed at llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:208!

#7 0x00000000022ba278
clang::CodeGen::CodeGenFunction::getEvaluationKind(clang::QualType)
(clang-5.0+0x22ba278)
#8 0x00000000023e0f68 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr
const*, clang::CodeGen::AggValueSlot, bool) (clang-5.0+0x23e0f68)
#9 0x00000000023f24bb
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*)
(clang-5.0+0x23f24bb)
#10 0x00000000022889b9 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*) (clang-5.0+0x22889b9)
#11 0x0000000002289a27
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) (clang-5.0+0x2289a27)
#12 0x00000000022ba473
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) (clang-5.0+0x22ba473)
#13 0x00000000022c5051
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (clang-5.0+0x22c5051)
#14 0x00000000022e4731
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (clang-5.0+0x22e4731)
#15 0x00000000022f81f1
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (clang-5.0+0x22f81f1)
#16 0x00000000022f9110
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
(clang-5.0+0x22f9110)
#17 0x00000000022f978a
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) [clone
.part.6520] (clang-5.0+0x22f978a)
#18 0x00000000028f9a63 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(clang-5.0+0x28f9a63)
#19 0x00000000028f3f4d
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(clang-5.0+0x28f3f4d)
#20 0x0000000002cec316 clang::ParseAST(clang::Sema&, bool, bool)
(clang-5.0+0x2cec316)
#21 0x00000000028f7c1f clang::CodeGenAction::ExecuteAction()
(clang-5.0+0x28f7c1f)
#22 0x00000000025ca156 clang::FrontendAction::Execute() (clang-5.0+0x25ca156)
#23 0x00000000025a26c6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(clang-5.0+0x25a26c6)
#24 0x00000000026567e4
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(clang-5.0+0x26567e4)

Stack dump:
1.      <eof> parser at end of file
2.      bug.cc:6:6: LLVM IR generation of declaration 'foo'
3.      bug.cc:6:6: Generating code for declaration 'foo'
clang-5.0: error: unable to execute command: Aborted (core dumped)
clang-5.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 5.0.0 (trunk)
Target: x86_64-unknown-linux-gnu
=========================================================================

-- 
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/20170615/a8d18c81/attachment-0001.html>


More information about the llvm-bugs mailing list