[llvm-bugs] [Bug 46435] New: Clang 10.0 segfault with temporary as template parameter

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 24 05:27:28 PDT 2020


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

            Bug ID: 46435
           Summary: Clang 10.0 segfault with temporary as template
                    parameter
           Product: clang
           Version: 10.0
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: stepan773 at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

Created attachment 23643
  --> https://bugs.llvm.org/attachment.cgi?id=23643&action=edit
Crash dump

Clang 10.0 crashes with a segfault when compiling the code below. Crash dump
attached.

Code to reproduce:

// clang++ -std=c++20 example.cpp -o example

#include <iostream>

template<size_t N>
struct const_literal {
  constexpr const_literal(const char (&v)[N]) {
    std::copy_n(v, N, value);
  }

  char value[N];
};

template<const auto& Name>
struct notation {
  template<typename OutputStream>
  static void print(OutputStream& output) {
    output << Name.value << "\n";
  }
};

using example = notation<const_literal("Example")>;

int main() {
  example::print(std::cout);

  return 0;
}

-- 
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/20200624/aa17fa6e/attachment.html>


More information about the llvm-bugs mailing list