[llvm-bugs] [Bug 45341] New: Crash in code generation or optimizer

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Mar 29 01:40:05 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45341

            Bug ID: 45341
           Summary: Crash in code generation or optimizer
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jvapen at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Created attachment 23284
  --> https://bugs.llvm.org/attachment.cgi?id=23284&action=edit
Reproduction.zip

When compiling with -fsyntax-only, I don't get the problem.
When compiling with LLVM 9.0.0, I also don't get a crash.

However, I'm unable to upgrade this project as the compilers have been fixed on
release. Some understanding of why this is happening would be useful to work
around these crashes. (Note that some manipulations can fix the crash on this
production without doing this on the original)


// C:\LLVM_7_0_0\bin\clang-cl.exe /c /EHsc -w /std:c++17 t.cpp
// See reproduction.zip for preprocessed code + .sh
#include <string>
#include <variant>
#include <vector>

struct A {
  std::basic_string<wchar_t> m;
};

struct B {
  B(A a);

  std::variant<A> m;
};
struct C : B {
  using B::B;
};

void f() {
  std::vector<C> c{};
  auto a = A{};
  auto b = C{std::move(a)};
  c.push_back(C{A{}});
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200329/141ba989/attachment-0001.html>


More information about the llvm-bugs mailing list