[llvm-bugs] [Bug 25659] New: Wrong formatting for "type<2>{}[0]"

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 27 10:34:56 PST 2015


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: unassignedclangbugs at nondot.org
          Reporter: gonzalobg88 at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20151127/1c787be0/attachment.html>


More information about the llvm-bugs mailing list