[llvm-bugs] [Bug 26890] New: Clang-format bad formatting of expression in template argument

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 9 11:43:00 PST 2016


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

            Bug ID: 26890
           Summary: Clang-format bad formatting of expression in template
                    argument
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: aizatsky at chromium.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The following function is formatted very badly by clang-format:

template <int N, typename TupleT>
typename std::enable_if< N < std::tuple_size<TupleT>::value, bool>::type
UnpackImpl(const uint8_t *Data, size_t Size, TupleT *Tuple) {
  size_t NewSize = UnpackSingle(Data, Size, &std::get<N>(*Tuple));
  if (NewSize == Size) {
    return false;
  }

  return UnpackImpl<N + 1, TupleT>(Data + (Size - NewSize), NewSize, Tuple);
}



It seems to be confused by N < ... expression inside enable_if.

-- 
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/20160309/8c6b087f/attachment.html>


More information about the llvm-bugs mailing list