<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 - Segfault with operator '^' overload for integer_sequences when specifying wrong parameter pack"
   href="https://bugs.llvm.org/show_bug.cgi?id=39231">39231</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Segfault with operator '^' overload for integer_sequences when specifying wrong parameter pack
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>7.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++14
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20980" name="attach_20980" title="Preprocessed source, associated run script and crash backtrace">attachment 20980</a> <a href="attachment.cgi?id=20980&action=edit" title="Preprocessed source, associated run script and crash backtrace">[details]</a></span>
Preprocessed source, associated run script and crash backtrace

The following code crashes.
Note the programming error, the function argument b of the overloaded operator^
takes the wrong parameter pack: A... instead of B..., which results in a
segfault on clang 7 (also tested with clang 6 and apple clang 9, where bug is
also present).

----

#include <utility>

template <typename T, T... A, T... B>
void operator^(std::integer_sequence<T, A...> a,
               std::integer_sequence<T, A...> b) {
  // programming error, argument b takes A... pack instead of B...
}

int main() {

  using T = uint64_t;
  std::integer_sequence<T, 1, 2, 3>{} ^ std::integer_sequence<T, 4, 5, 6>{};
  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>