Skip to content

Conversation

@backes
Copy link
Contributor

@backes backes commented Jul 24, 2017

Before C++11, we were using a hack to disable copy constructors or copy
assignment by declaring the methods private and not implementing them.
This hack required the respective macros to be placed in the private:
declarations of a class.
The macros have switched to use the C++11 "= delete" syntax some time
ago in both v8 and chromium:
https://codereview.chromium.org/1123723003/
https://codereview.chromium.org/2017213002

Also the comments are now updated, since the macros do not need to be
in the private: declarations any more:
https://chromium-review.googlesource.com/c/577687
https://chromium-review.googlesource.com/c/578027

This change also removes the presubmit check that checked that the
macros are only used in the private declarations.

Before C++11, we were using a hack to disable copy constructors or copy
assignment by declaring the methods private and not implementing them.
This hack required the respective macros to be placed in the private:
declarations of a class.
The macros have switched to use the C++11 "= delete" syntax some time
ago in both v8 and chromium:
https://codereview.chromium.org/1123723003/
https://codereview.chromium.org/2017213002

Also the comments are now updated, since the macros do not need to be
in the private: declarations any more:
https://chromium-review.googlesource.com/c/577687
https://chromium-review.googlesource.com/c/578027

This change also removes the presubmit check that checked that the
macros are only used in the private declarations.
@eglaysher eglaysher merged commit 0c1c7f1 into google:gh-pages Jul 26, 2017
@vith
Copy link

vith commented Jul 26, 2017

Looks like the unit tests need to to be updated to reflect this change.

$ python2 cpplint_unittest.py 
.......................................................................................................F....................................................................
======================================================================
FAIL: testMisplacedDisallowMacros (__main__.CpplintTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "cpplint_unittest.py", line 1987, in testMisplacedDisallowMacros
    '  [readability/constructors] [3]')
  File "cpplint_unittest.py", line 220, in TestMultiLineLint
    self.assertEquals(expected_message, self.PerformMultiLineLint(code))
AssertionError: 'DISALLOW_COPY_AND_ASSIGN must be in the private: section  [readability/constructors] [3]' != ''

----------------------------------------------------------------------
Ran 172 tests in 0.547s

FAILED (failures=1)

@eglaysher
Copy link
Contributor

I went and fixed up the tests in 6c8669e.

@backes
Copy link
Contributor Author

backes commented Jul 29, 2017

Thanks for fixing the tests, Elliot!

@backes backes deleted the remove-disallow-presubmit-check branch July 29, 2017 09:37
robin-raymond pushed a commit to webrtc-uwp/depot_tools that referenced this pull request Aug 25, 2017
Before C++11, we were using a hack to disable copy constructors or copy
assignment by declaring the methods private and not implementing them.
This hack required the respective macros to be placed in the private:
declarations of a class.
The macros have switched to use the C++11 "= delete" syntax some time
ago in both v8 and chromium:
https://codereview.chromium.org/1123723003/
https://codereview.chromium.org/2017213002

Also the comments are now updated, since the macros do not need to be
in the private: declarations any more:
https://chromium-review.googlesource.com/c/577687
https://chromium-review.googlesource.com/c/578027

This change removes the presubmit check that checked that the
macros are only used in the private declarations.

This is a cherry-pick from google/styleguide#265.

R=jochen@chromium.org

Change-Id: I224005a17c3de2569b64622e6cf8c9688665637d
Reviewed-on: https://chromium-review.googlesource.com/579187
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
zasgar referenced this pull request in pixie-io/cpplint Sep 2, 2021
…it-check

Remove presubmit check for DISALLOW_* macros
abeir pushed a commit to abeir/depot_tools that referenced this pull request Apr 24, 2024
Patch Set 1:

> Patch Set 1:
> 
> no, it's https://github.com/google/styleguide/tree/gh-pages/cpplint (also, please don't post links to internal sites..)

I created a pull request:
google/styleguide#265

Once this lands, what's the procedure? Update the CL description and also land this one?

Patch-set: 1
Reviewer: Gerrit User 1177599 <1177599@3ce6091f-6c88-37e8-8c75-72f92ae8dfba>
abeir pushed a commit to abeir/depot_tools that referenced this pull request Apr 24, 2024
Patch Set 1:

> Patch Set 1:
> 
> > Patch Set 1:
> > 
> > no, it's https://github.com/google/styleguide/tree/gh-pages/cpplint (also, please don't post links to internal sites..)
> 
> I created a pull request:
> google/styleguide#265
> 
> Once this lands, what's the procedure? Update the CL description and also land this one?

I wonder what the diff to the upstream version looks like. If we can't easily just copy the upstream version, we should file a bug and land this CL

Patch-set: 1
Reviewer: Gerrit User 1176519 <1176519@3ce6091f-6c88-37e8-8c75-72f92ae8dfba>
abeir pushed a commit to abeir/depot_tools that referenced this pull request Apr 24, 2024
Patch Set 2:

> Patch Set 1:
> 
> > Patch Set 1:
> > 
> > > Patch Set 1:
> > > 
> > > no, it's https://github.com/google/styleguide/tree/gh-pages/cpplint (also, please don't post links to internal sites..)
> > 
> > I created a pull request:
> > google/styleguide#265
> > 
> > Once this lands, what's the procedure? Update the CL description and also land this one?
> 
> I wonder what the diff to the upstream version looks like. If we can't easily just copy the upstream version, we should file a bug and land this CL

The diff to upstream is >100 lines. Mostly about the 'project_root' and 'headers' options.
Anyway, I updated the description of this CL to link to the github pull request, and would propose to just land this now. It definitely reduces the diff :)

Patch-set: 2
Reviewer: Gerrit User 1177599 <1177599@3ce6091f-6c88-37e8-8c75-72f92ae8dfba>
abeir pushed a commit to abeir/depot_tools that referenced this pull request Apr 24, 2024
Before C++11, we were using a hack to disable copy constructors or copy
assignment by declaring the methods private and not implementing them.
This hack required the respective macros to be placed in the private:
declarations of a class.
The macros have switched to use the C++11 "= delete" syntax some time
ago in both v8 and chromium:
https://codereview.chromium.org/1123723003/
https://codereview.chromium.org/2017213002

Also the comments are now updated, since the macros do not need to be
in the private: declarations any more:
https://chromium-review.googlesource.com/c/577687
https://chromium-review.googlesource.com/c/578027

This change removes the presubmit check that checked that the
macros are only used in the private declarations.

This is a cherry-pick from google/styleguide#265.

R=jochen@chromium.org

Change-Id: I224005a17c3de2569b64622e6cf8c9688665637d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants