]> granicus.if.org Git - clang/commit
[clang-format] BreakAfterReturnType ignored on functions with numeric template parameters
authorPaul Hoad <mydeveloperday@gmail.com>
Sat, 6 Apr 2019 10:13:04 +0000 (10:13 +0000)
committerPaul Hoad <mydeveloperday@gmail.com>
Sat, 6 Apr 2019 10:13:04 +0000 (10:13 +0000)
commit4282d4f2c2ed3435f7987382faa978311a9d057a
tree8abf0987b599ca48ef0b4e0f7f72d06f7bffb5cb
parent1374cdc16054f52055eb408fabc9cec425db60a7
[clang-format] BreakAfterReturnType ignored on functions with numeric template parameters

Summary:
Addresses PR40696 - https://bugs.llvm.org/show_bug.cgi?id=40696

The BreakAfterReturnType didn't work if it had a single arguments which was a template with an integer template parameter

```
int  foo(A<8> a) { return a; }
```

When run with the Mozilla style. would not break after the `int`

```
int TestFn(A<8> a)
{
  return a;
}

```

This revision resolves this issue by allowing numeric constants to be considered function parameters if if seen inside `<>`

Reviewers: djasper, klimek, JonasToth, krasimir, reuk, alexfh

Reviewed By: klimek

Subscribers: cfe-commits, llvm-commits

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D59309

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357837 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTest.cpp