<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Crash with 'operator auto'"
   href="https://bugs.llvm.org/show_bug.cgi?id=33471">33471</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash with 'operator auto'
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Keywords</th>
          <td>crash-on-invalid
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++14
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>v.reichelt@netcologne.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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
=========================================================================</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>