<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Clang 10.0 segfault with temporary as template parameter"
   href="https://bugs.llvm.org/show_bug.cgi?id=46435">46435</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang 10.0 segfault with temporary as template parameter
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++2a
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>stepan773@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23643" name="attach_23643" title="Crash dump">attachment 23643</a> <a href="attachment.cgi?id=23643&action=edit" title="Crash dump">[details]</a></span>
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;
}</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>