<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 - -ast-dump-all crashes on empty files"
   href="https://bugs.llvm.org/show_bug.cgi?id=32318">32318</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>-ast-dump-all crashes on empty files
          </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>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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>aaron@aaronballman.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If the file contains no declarations or lookups, then calling -ast-dump-all
asserts.

What's interesting is that a regular -ast-dump has content.

D:\llvm\build\Debug\bin>touch test.c
D:\llvm\build\Debug\bin>clang -cc1 -ast-dump test.c
TranslationUnitDecl 0x2225c9eead0 <<invalid sloc>> <invalid sloc>
|-TypedefDecl 0x2225c9ef020 <<invalid sloc>> <invalid sloc> implicit __int128_t
'__int128'
| `-BuiltinType 0x2225c9eed40 '__int128'
|-TypedefDecl 0x2225c9ef088 <<invalid sloc>> <invalid sloc> implicit
__uint128_t 'unsigned __int128'
| `-BuiltinType 0x2225c9eed60 'unsigned __int128'
|-TypedefDecl 0x2225c9ef378 <<invalid sloc>> <invalid sloc> implicit
__NSConstantString 'struct __NSConstantString_tag'
| `-RecordType 0x2225c9ef160 'struct __NSConstantString_tag'
|   `-Record 0x2225c9ef0d8 '__NSConstantString_tag'
|-TypedefDecl 0x2225c9ef410 <<invalid sloc>> <invalid sloc> implicit
__builtin_ms_va_list 'char *'
| `-PointerType 0x2225c9ef3d0 'char *'
|   `-BuiltinType 0x2225c9eeb60 'char'
`-TypedefDecl 0x2225c9ef478 <<invalid sloc>> <invalid sloc> implicit
__builtin_va_list 'char *'
  `-PointerType 0x2225c9ef3d0 'char *'
    `-BuiltinType 0x2225c9eeb60 'char'

D:\llvm\build\Debug\bin>clang -cc1 -ast-dump-all test.c
Assertion failed: (DumpDecls || DumpLookups) && "nothing to dump", file
D:\llvm\llvm\tools\clang\lib\Frontend\ASTConsumers.cpp, line 145
Wrote crash dump file
"C:\Users\aballman\AppData\Local\Temp\clang.exe-abbfb1.dmp"
#0 0x00007ff7a30d2f8c HandleAbort
d:\llvm\llvm\lib\support\windows\signals.inc:405:0
#1 0x00007ff93b431c81 (C:\Windows\SYSTEM32\ucrtbased.dll+0x81c81)
#2 0x00007ff93b4338a9 (C:\Windows\SYSTEM32\ucrtbased.dll+0x838a9)
#3 0x00007ff93b439495 (C:\Windows\SYSTEM32\ucrtbased.dll+0x89495)
#4 0x00007ff93b438ff7 (C:\Windows\SYSTEM32\ucrtbased.dll+0x88ff7)
#5 0x00007ff93b437061 (C:\Windows\SYSTEM32\ucrtbased.dll+0x87061)
#6 0x00007ff93b439a3f (C:\Windows\SYSTEM32\ucrtbased.dll+0x89a3f)
#7 0x00007ff7a40471d8 clang::CreateASTDumper(class
llvm::StringRef,bool,bool,bool)
d:\llvm\llvm\tools\clang\lib\frontend\astconsumers.cpp:145:0
#8 0x00007ff7a3fc19a2 clang::ASTDumpAction::CreateASTConsumer(class
clang::CompilerInstance &,class llvm::StringRef)
d:\llvm\llvm\tools\clang\lib\frontend\frontendactions.cpp:58:0
#9 0x00007ff7a3fb65c5 clang::FrontendAction::CreateWrappedASTConsumer(class
clang::CompilerInstance &,class llvm::StringRef)
d:\llvm\llvm\tools\clang\lib\frontend\frontendaction.cpp:143:0
#10 0x00007ff7a3fb7bad clang::FrontendAction::BeginSourceFile(class
clang::CompilerInstance &,class clang::FrontendInputFile const &)
d:\llvm\llvm\tools\clang\lib\frontend\frontendaction.cpp:387:0
#11 0x00007ff7a3f24aec clang::CompilerInstance::ExecuteAction(class
clang::FrontendAction &)
d:\llvm\llvm\tools\clang\lib\frontend\compilerinstance.cpp:949:0
#12 0x00007ff7a415e206 clang::ExecuteCompilerInvocation(class
clang::CompilerInstance *)
d:\llvm\llvm\tools\clang\lib\frontendtool\executecompilerinvocation.cpp:249:0
#13 0x00007ff7a0136194 cc1_main(class llvm::ArrayRef<char const *>,char const
*,void *) d:\llvm\llvm\tools\clang\tools\driver\cc1_main.cpp:221:0
#14 0x00007ff7a011a4dd ExecuteCC1Tool
d:\llvm\llvm\tools\clang\tools\driver\driver.cpp:299:0
#15 0x00007ff7a011ad8c main
d:\llvm\llvm\tools\clang\tools\driver\driver.cpp:380:0
#16 0x00007ff7a7bdf194 invoke_main
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:65:0
#17 0x00007ff7a7bdf057 __scrt_common_main_seh
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253:0
#18 0x00007ff7a7bdef1e __scrt_common_main
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:296:0
#19 0x00007ff7a7bdf1b9 mainCRTStartup
f:\dd\vctools\crt\vcstartup\src\startup\exe_main.cpp:17:0
#20 0x00007ff968d88364 (C:\Windows\System32\KERNEL32.DLL+0x8364)
#21 0x00007ff96b8570d1 (C:\Windows\SYSTEM32\ntdll.dll+0x670d1)</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>