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: unassignedclangb...@nondot.org
          Reporter: stepan...@gmail.com
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-l...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to