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

            Bug ID: 39231
           Summary: Segfault with operator '^' overload for
                    integer_sequences when specifying wrong parameter pack
           Product: clang
           Version: 7.0
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: unassignedclangb...@nondot.org
          Reporter: niekbou...@gmail.com
                CC: llvm-bugs@lists.llvm.org

Created attachment 20980
  --> https://bugs.llvm.org/attachment.cgi?id=20980&action=edit
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;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to