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

            Bug ID: 25659
           Summary: Wrong formatting for "type<2>{}[0]"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
    Classification: Unclassified

Minimal example, given:

template<int n> 
struct a{
  std::array<int, 2> operator[] const { return std::array<int, 2>{}; }
};

the function:


int foo() {
  return a<2>{}[0];
}

gets formatted as:

int foo() {
  return a<2>{}
  [0];
}

but using () instead of {} to construct the a<2> object gets formatted as
expected:

int foo() {
  return a<2>()[0];
}

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

Reply via email to