LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 33697 - clang-format aligns "=" of "operator=" with "= deleted" if copy assignment operator is deleted
Summary: clang-format aligns "=" of "operator=" with "= deleted" if copy assignment op...
Status: NEW
Alias: None
Product: clang
Classification: Unclassified
Component: Formatter (show other bugs)
Version: 4.0
Hardware: PC Windows NT
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-06 03:31 PDT by Frank Sommer
Modified: 2018-03-20 13:46 PDT (History)
4 users (show)

See Also:
Fixed By Commit(s):


Attachments
clang-format configuration file (7.80 KB, text/plain)
2017-07-06 03:31 PDT, Frank Sommer
Details
Example output file (513 bytes, text/plain)
2017-07-06 03:42 PDT, Frank Sommer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Sommer 2017-07-06 03:31:30 PDT
Created attachment 18757 [details]
clang-format configuration file

If a long class name leads to a line break within the declaration of a deleted copy assignment operator the “=” sign of "operator=" is aligned with the “=” of the “= delete”. The following section shows the formatted output:

ExampleFile.hxx

class SomeClassWithARatherLongNameWhichBreaksTheColumnLimit
{
public:
  SomeClassWithARatherLongNameWhichBreaksTheColumnLimit();
  virtual ~SomeClassWithARatherLongNameWhichBreaksTheColumnLimit();

private:
  SomeClassWithARatherLongNameWhichBreaksTheColumnLimit(
      const SomeClassWithARatherLongNameWhichBreaksTheColumnLimit& other) = delete;
  SomeClassWithARatherLongNameWhichBreaksTheColumnLimit& operator         =(
      const SomeClassWithARatherLongNameWhichBreaksTheColumnLimit& other) = delete;
};


Attached you find the clang-format configuration file we used for formatting.
Comment 1 Frank Sommer 2017-07-06 03:42:00 PDT
Created attachment 18758 [details]
Example output file