<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJztWlmT27gR_jWaF5RUvI8HPWg1M84kTnliTSWPKhAEJWRIgAbBsbS_fhugDoI67GykzcPGRXMoNI7-vm4AjSMT-XY6LzFfISJxs6YN-r5mJUVKbhkkKoGIqGqTsqaoEGUpvmsBK8txIWRFc8iQ05E_GzmPI2f_jpzdY342SrZEoYWLRvEvXRJCjCuER771e-RF2SFpFD8ev616vH49UOvmShkieGOKNB4Ucq0Mtpbdey6qCvMclYz3UA1yegEihrRx0Wy5wpux4OUWjRuVj_xHMvJ-gcd1B2JFGzUh5Erjn0SeiVIhSWsp8pZQCSqgtVJ1o3XxnuFZdXkmQq7g16_wPwnecFN8879dMcFCYfKO8raqD6CcychJX6VYSVwhLFdtRbnS7YAZnkWt4L2zvRzTTV0KCepAmgY-xk1DpWJA7hiMwt9BkDG-F3cEoDEQJHRtuK51na2qWzVp0HiBxuMVIWMlREnWGAr6j1cb1ZkbjutmLRSwSgQIxjnDKy4axQhUWXAxNi5sJw8tMvLnjWglAds-dTS4mgYr2Z-5jn6FmgvSSgm8oBpLQAwd4p1ygBRrL4J354Qjz3eQs3HgXxhGcRo4fuFkBXqV4NWG-jeJCV2wFcflX8C9So0q-RAsH3lg1xR1omZCam0gx_w_1O0O6iaUOqgsPyptS3_WbJvuY15SzNv6C-9qgxZa3sAndNJSaKukUFtyI-vC42x8bJSBmo_aen1t_SIOYy9Bc22ar5SIDyq3Qx6AJK2blWcuuKIbdZ4Qf9dEXASpExCa-sRBy6WEDgY4llLtcJYsg_cmiZZRMIYe3W7GK952glqtJcX5pBETx2BxQ6jFQhL0kUR5kLtx0nX8ju-FqlT3taJqYfznKwipaTxF3dBzY8aj2Khh6RlaegYxzRxXt4u54NtKtA3iuKJNDS6oyxmNXzhTn1mj5mtK3s04A88zDOsv_Kmq1VbLn4V8ZrTM-45kbDXvs2CyPFJSGle2RLoShkv2K82fuGJq23ECw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upmALSzoDkG0MLlkmw2rtv9yHDDyLIx-XcsWZl1wlJJzPSxSCceVAfotNMLeZR3TfZWLrPDXnBXZuTFJa6yHOvzgwNbgHW3Rf9XkZ03STLcWM9hIXbEfW77vJN8bfkCF7TcWoxet94dzgpSo7Hl2unAy3BAIvQn95KbD42eobXP--C0KnGKxF7oWrwbFfDJlLo3hjXaDwqao9QLi9YrWWe7AepOfBi4Fh_2CVviOkFe_Kd8QL9tLpMBUr0JeGHj53TIPjhPjZn2m9Nd9qv87T3snjQaliwavQGNSZxcdKvH3rcVSpyJIS7R_8fSeHsCNT8Wgb491Ts-SQqkw5XbxxmmbqvxwDpVjdPUyXy0XJYs08MfLG2XPU2uHa0SfagamXa8GCqxWhlGZdgFH-nqv0MwpWs_NN8VdwOwNKJSCnO7wiSiYhdk6-suxgUKDI3n6DusoxHdMGWuuSDXN27QNhSNP_TtmIZSxHqR7x7o_vbFQz7189RP8QNu1VrIacW27Tt7aGU5HdzrgJZamPlFpUnULt39GddS_BtcGn6ypmn1ZuJz6DtB9LCeFjgJSeJ7pMjivHDzkJI4wB72opBSL8sfSpzRspmOQiDE2zv9Hisk6b6gJebihOBjgIJLZiTh48N_ryKbeo7nOa4TubGX-MGEphjj2I1hrEgwgWYCBxa_rJzoevSdlgc5NVVm7aoBYQljZnMUgun12Rc1iEBDxVRJ-xeYwBjW6Qr6vqYc1foehr62hNHxdggqhESYo5az40Y-gmCISn0cgCpaZVQ-GERTA-c3zyxsbA>53046</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang crash in SemaInit.cpp when printing a diagnostic for an uninitialized reference member
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend,
            crash-on-invalid
      </td>
    </tr>

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

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

<pre>
    Clang crashes while trying to compile the following ill-formed code:

```
struct S1 {
  int a;
  int &b;
};

struct S2 {
  S1 x;
};

const S2 s2{1};
```

Command line:
```
$ clang -fsyntax-only -std=c++11 -fsyntax-only test.cc
```

Godbolt reproducer: https://godbolt.org/z/84Tasfq3q

```
Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -g -o /app/output.s -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -std=c++11 <source>
1.      <source>:10:15: current parser token ';'
 #0 0x000055679403f0bf PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x000055679403cee0 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3a3cee0)
 #2 0x0000556793f75728 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007f4904ce93c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #4 0x0000556796d4d178 clang::Stmt::getSourceRange() const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x674d178)
 #5 0x000055679647eb01 (anonymous namespace)::InitListChecker::FillInEmptyInitForField(unsigned int, clang::FieldDecl*, clang::InitializedEntity const&, clang::InitListExpr*, bool&, bool) SemaInit.cpp:0:0
 #6 0x000055679647efd8 (anonymous namespace)::InitListChecker::FillInEmptyInitializations(clang::InitializedEntity const&, clang::InitListExpr*, bool&, clang::InitListExpr*, unsigned int, bool) SemaInit.cpp:0:0
 #7 0x000055679647e9e4 (anonymous namespace)::InitListChecker::FillInEmptyInitForField(unsigned int, clang::FieldDecl*, clang::InitializedEntity const&, clang::InitListExpr*, bool&, bool) SemaInit.cpp:0:0
 #8 0x000055679647efd8 (anonymous namespace)::InitListChecker::FillInEmptyInitializations(clang::InitializedEntity const&, clang::InitListExpr*, bool&, clang::InitListExpr*, unsigned int, bool) SemaInit.cpp:0:0
 #9 0x0000556796474b8d (anonymous namespace)::InitListChecker::InitListChecker(clang::Sema&, clang::InitializedEntity const&, clang::InitListExpr*, clang::QualType&, bool, bool, bool) SemaInit.cpp:0:0
#10 0x00005567964775b0 diagnoseListInit(clang::Sema&, clang::InitializedEntity const&, clang::InitListExpr*) SemaInit.cpp:0:0
#11 0x0000556796477a54 clang::InitializationSequence::Diagnose(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::ArrayRef<clang::Expr*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5e77a54)
#12 0x000055679647a175 clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5e7a175)
#13 0x00005567961aacbe clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5baacbe)
#14 0x0000556795f6064a clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x596064a)
#15 0x0000556795f70037 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5970037)
#16 0x0000556795f4a2d9 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x594a2d9)
#17 0x0000556795f4aa21 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.280) Parser.cpp:0:0
#18 0x0000556795f4ac10 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x594ac10)
#19 0x0000556795f4b869 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x594b869)
#20 0x0000556795f419d9 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x59419d9)
#21 0x000055679505bbb8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4a5bbb8)
#22 0x00005567949f65f1 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x43f65f1)
#23 0x00005567949921ea clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x43921ea)
#24 0x0000556794ac5b83 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x44c5b83)
#25 0x00005567919df27c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x13df27c)
#26 0x00005567919da619 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#27 0x0000556794838145 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#28 0x0000556793f75d13 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3975d13)
#29 0x000055679483a4c6 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x423a4c6)
#30 0x000055679480f84a clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x420f84a)
#31 0x00005567948104df clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x42104df)
#32 0x000055679481878a clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x421878a)
#33 0x0000556791903c8f main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x1303c8f)
#34 0x00007f49047990b3 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b3)
#35 0x00005567919da18a _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x13da18a)
clang-14: error: clang frontend command failed with exit code 139 (use -v to see invocation)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztWlmT27gR_jWaF5RUvI8HPWg1M84kTnliTSWPKhAEJWRIgAbBsbS_Pg1QB0Ed9m5Juw8bF82h0Dj6-7oBNI5M5NvpvMR8hYjEzZo26PualRQpuWWQqAQioqpNypqiQpSl-K4FrCzHhZAVzSFDTkf-bOQ8jpz9O3J2j_nZKNkShRYuGsW_dEkIMa4QHvnW75EXZYekUfx4_Lbq8fr1QK2bK2WI4I0p0nhQyLUy2Fp277moKsxzVDLeQzXI6QWIGNLGRbPlCm_GgpdbNG5UPvIfycj7BR7XHYgVbdSEkCuNfxJ5JkqFJK2lyFtCJaiA1krVjdbFe4Zn1eWZCLmCX7_C_yR4w03xzf92xQQLhck7ytuqPoByJiMnfZViJXGFsFy1FeVKtwNmeBa1gvfO9nJMN3UpJKgDaRr4GDcNlYoBuWMwCn8HQcb4XtwRgMZAkNC14brWdbaqbtWkQeMFGo9XhIyVECVZYyjoP15tVGduOK6btVDAKhEgGOcMr7hoFCN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