<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 - [Windows] sema forgot to instantiate default args"
   href="https://bugs.llvm.org/show_bug.cgi?id=31996">31996</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Windows] sema forgot to instantiate default args
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.9
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

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

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

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

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

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

        <tr>
          <th>Reporter</th>
          <td>eric@andante.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18002" name="attach_18002" title="Zip file containing the cpp output and the .sh file that was written to the temp directory.">attachment 18002</a> <a href="attachment.cgi?id=18002&action=edit" title="Zip file containing the cpp output and the .sh file that was written to the temp directory.">[details]</a></span>
Zip file containing the cpp output and the .sh file that was written to the
temp directory.

If I compile the enclosed testcase, then clang crashes.  I see this both with
prebuilt binaries and with the binaries that I built myself.

The failure is:
Assertion failed: DefaultArg && "sema forgot to instantiate default args", file
D:\Users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\CodeGen\MicrosoftCXXABI.cpp,
line 3871

My stacktrace is:
0:000> k
ChildEBP RetAddr  
00c2ad80 0f93f7f9 clang!HandleAbort+0x9
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\lib\support\windows\signals.inc
@ 404]
WARNING: Stack unwind information not available. Following frames may be wrong.
00c2addc 0f94b284 MSVCR120D!raise+0x2b9
00c2adec 0f939ac4 MSVCR120D!abort+0x34
00c2b930 021d3674 MSVCR120D!wassert+0xd4
00c2c7e0 021ca7be clang!`anonymous
namespace'::MicrosoftCXXABI::getAddrOfCXXCtorClosure+0x634
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\codegen\microsoftcxxabi.cpp
@ 3871]
00c2c7fc 01f9db58 clang!`anonymous
namespace'::MicrosoftCXXABI::EmitCXXConstructors+0x8e
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\codegen\microsoftcxxabi.cpp
@ 1196]
00c2d240 047ae98e clang!clang::CodeGen::CodeGenModule::EmitTopLevelDecl+0x2d8
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\codegen\codegenmodule.cpp
@ 3815]
00c2d26c 047ac5b5 clang!`anonymous
namespace'::CodeGeneratorImpl::HandleTopLevelDecl+0x8e
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\codegen\modulebuilder.cpp
@ 148]
00c2d2b0 03c113a6 clang!clang::BackendConsumer::HandleTopLevelDecl+0x85
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\codegen\codegenaction.cpp
@ 119]
00c2d5a4 03c10000 clang!clang::Sema::InstantiateFunctionDefinition+0x976
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\sema\sematemplateinstantiatedecl.cpp
@ 3697]
00c2d624 03c113dc clang!clang::Sema::PerformPendingInstantiations+0x110
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\sema\sematemplateinstantiatedecl.cpp
@ 4896]
00c2d918 03c10000 clang!clang::Sema::InstantiateFunctionDefinition+0x9ac
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\sema\sematemplateinstantiatedecl.cpp
@ 3715]
00c2d998 03504883 clang!clang::Sema::PerformPendingInstantiations+0x110
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\sema\sematemplateinstantiatedecl.cpp
@ 4896]
00c2dde4 0323b4c4 clang!clang::Sema::ActOnEndOfTranslationUnit+0x143
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\sema\sema.cpp
@ 688]
00c2de5c 0323920f clang!clang::Parser::ParseTopLevelDecl+0x224
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\parse\parser.cpp
@ 585]
00c2def8 024c12b1 clang!clang::ParseAST+0x1df
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\parse\parseast.cpp
@ 160]
00c2df1c 047a8768 clang!clang::ASTFrontendAction::ExecuteAction+0x101
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\frontend\frontendaction.cpp
@ 557]
00c2e110 024c0e74 clang!clang::CodeGenAction::ExecuteAction+0x478
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\codegen\codegenaction.cpp
@ 854]
00c2e140 0246de6d clang!clang::FrontendAction::Execute+0x84
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\frontend\frontendaction.cpp
@ 457]
00c2e1d4 025bc30b clang!clang::CompilerInstance::ExecuteAction+0x35d
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\frontend\compilerinstance.cpp
@ 868]
00c2e2a0 00d574dd clang!clang::ExecuteCompilerInvocation+0x3eb
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\lib\frontendtool\executecompilerinvocation.cpp
@ 241]
00c2e7cc 00d438f8 clang!cc1_main+0x38d
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\tools\driver\cc1_main.cpp
@ 116]
00c2e800 00d43f63 clang!ExecuteCC1Tool+0x78
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\tools\driver\driver.cpp
@ 301]
00c2f75c 045d5cb9 clang!main+0x5c3
[d:\users\eyoungdale\work\llvm390\llvm-3.9.1.src\tools\clang\tools\driver\driver.cpp
@ 382]

I also have a minidump that I got from the prebuilt binary - that seems less
useful unless somebody has debug symbols tucked away somewhere.</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>