<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/113217>113217</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang crashes at -O0 on on x86_64-linux-gnu: clang frontend command failed in compound statement ('{}')
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          bi6c
      </td>
    </tr>
</table>

<pre>
    Compiler Explorer: https://godbolt.org/z/KbqY94EYr
```console
<source>:6:19: error: statement expression not allowed at file scope
    6 | typedef __typeof( ({ (struct { foo *x; char y[8]; }){ }; }) ) wuz;
      | ^
<source>:21:22: warning: too many braces around scalar initializer [-Wmany-braces-around-scalar-init]
   21 |     struct foo s = {{{}, {.y="hello"}}, {}};
      |                      ^~
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-trunk/bin/clang -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -O0 <source>
1.      <source>:21:44: current parser token ';'
2.      <source>:20:1: parsing function body 'main'
3.      <source>:20:1: in compound statement ('{}')
 #0 0x00000000039573c8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x39573c8)
 #1 0x0000000003955534 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3955534)
 #2 0x00000000038a5f38 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x000077d1b8242520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x0000000006ac5918 (anonymous namespace)::InitListChecker::CheckExplicitInitList(clang::InitializedEntity const&, clang::InitListExpr*, clang::QualType&, clang::InitListExpr*, bool) (.constprop.0) SemaInit.cpp:0:0
 #5 0x0000000006ac5d0e (anonymous namespace)::InitListChecker::InitListChecker(clang::Sema&, clang::InitializedEntity const&, clang::InitListExpr*, clang::QualType&, bool, bool, bool, llvm::SmallVectorImpl<clang::QualType>*) SemaInit.cpp:0:0
 #6 0x0000000006ac7e64 clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x6ac7e64)
 #7 0x0000000006ad5eea (anonymous namespace)::InitListChecker::CheckSubElementType(clang::InitializedEntity const&, clang::InitListExpr*, clang::QualType, unsigned int&, clang::InitListExpr*, unsigned int&, bool) SemaInit.cpp:0:0
 #8 0x0000000006ad6bdc (anonymous namespace)::InitListChecker::CheckStructUnionTypes(clang::InitializedEntity const&, clang::InitListExpr*, clang::QualType, llvm::iterator_range<clang::CXXBaseSpecifier const*>, clang::DeclContext::specific_decl_iterator<clang::FieldDecl>, bool, unsigned int&, clang::InitListExpr*, unsigned int&, bool) SemaInit.cpp:0:0
 #9 0x0000000006ac47de (anonymous namespace)::InitListChecker::CheckListElementTypes(clang::InitializedEntity const&, clang::InitListExpr*, clang::QualType&, bool, unsigned int&, clang::InitListExpr*, unsigned int&, bool) (.constprop.0) SemaInit.cpp:0:0
#10 0x0000000006ac54aa (anonymous namespace)::InitListChecker::CheckExplicitInitList(clang::InitializedEntity const&, clang::InitListExpr*, clang::QualType&, clang::InitListExpr*, bool) (.constprop.0) SemaInit.cpp:0:0
#11 0x0000000006ac5d0e (anonymous namespace)::InitListChecker::InitListChecker(clang::Sema&, clang::InitializedEntity const&, clang::InitListExpr*, clang::QualType&, bool, bool, bool, llvm::SmallVectorImpl<clang::QualType>*) SemaInit.cpp:0:0
#12 0x0000000006ac7e64 clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x6ac7e64)
#13 0x0000000006656919 clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x6656919)
#14 0x00000000062c972a clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x62c972a)
#15 0x00000000062df2dc clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x62df2dc)
#16 0x00000000062e1e0a clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x62e1e0a)
#17 0x00000000062e230f clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x62e230f)
#18 0x0000000006395d94 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x6395d94)
#19 0x00000000063966ed clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x63966ed)
#20 0x0000000006397a01 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x6397a01)
#21 0x0000000006399c2a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x6399c2a)
#22 0x0000000006295bb6 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x6295bb6)
#23 0x00000000062df73f clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x62df73f)
#24 0x000000000628e167 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-trunk/bin/clang+0x628e167)
#25 0x000000000628ef83 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-trunk/bin/clang+0x628ef83)
#26 0x0000000006298872 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x6298872)
#27 0x000000000629a108 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x629a108)
#28 0x00000000062887da clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x62887da)
#29 0x000000000429ef35 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-trunk/bin/clang+0x429ef35)
#30 0x0000000004566d91 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-trunk/bin/clang+0x4566d91)
#31 0x00000000044e691b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x44e691b)
#32 0x000000000464b343 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-trunk/bin/clang+0x464b343)
#33 0x0000000000ce639c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-trunk/bin/clang+0xce639c)
#34 0x0000000000cdedfd ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#35 0x00000000042e7549 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#36 0x00000000038a6363 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-trunk/bin/clang+0x38a6363)
#37 0x00000000042e7769 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#38 0x00000000042ae91d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x42ae91d)
#39 0x00000000042af91d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-trunk/bin/clang+0x42af91d)
#40 0x00000000042b936c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-trunk/bin/clang+0x42b936c)
#41 0x0000000000ce30f1 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-trunk/bin/clang+0xce30f1)
#42 0x0000000000bb6014 main (/opt/compiler-explorer/clang-trunk/bin/clang+0xbb6014)
#43 0x000077d1b8229d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#44 0x000077d1b8229e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#45 0x0000000000cde89e _start (/opt/compiler-explorer/clang-trunk/bin/clang+0xcde89e)
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
```
Code:
```c
#include <stdio.h>
#include <string.h>

typedef struct inner foo;
typedef __typeof( ({ (struct { foo *x; char y[8]; }){ }; }) ) wuz;

struct inner { int z; };

struct foo {
    wuz a, b;
};

void f()
{
    printf("f() called\n");
}

int main()
{
 struct foo s = {{{}, {.y="hello"}}, {}};
    printf("Size of foo: %zu bytes\n", sizeof(s));
    printf("Value of x in a: %p, b: %p\n", s.a.x, s.b.x);
    printf("String in struct foo: \'%s\'\n", s.a.y);
    
    f();
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsW11z2zaz_jXwDUYaEvy-8IUsWz1p00lOlNPTXmlAEJRxQgEsADqSL85vfwcgKRGUZDu23Om8bzOOzQ9g8eyzi90lSGCl2JpTeg2iGxDdXuFG3wt5nbOYXOWi2F3PxaZmFZXwbltXQlIJghm817pWIJgBtABosRZFLio9FXIN0OIRoMUv-Z9_ZOHdHxJ4t8Cbgdhrf4jgSlS0uxrMlWgkoSC4A8EsBsHMz4x0KqWwwyiNNd1QriHd1pIqxQSHXGiIq0p8pwXEGpasolARUXdSIYQwhiCZQ72raUFLuFqZI1EClEKAUpDcmD9Ky4ZoaM5KISBAsy0IbiC5xxLuQHSTgujWXADJLUCZ7ZQMLkDz_3vzCIKbw7jQjguiu5MKIt_8Qkax71hyxtfmUAsBN5jvYC4xoQpiKRpeQEVwhSVknGmGK_ZIJQTRzeR_TdNJ23TSNp20TSemqcHco0G-RWP-dboaPRUEwa3Ruv-5BWh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