You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Andrew Wong (Code Review)" <ge...@cloudera.org> on 2018/11/21 00:48:20 UTC

[kudu-CR] build: don't instantiate const member with no user-defined constructor

Hello Alexey Serbin, Adar Dembo,

I'd like you to do a code review. Please visit

    http://gerrit.cloudera.org:8080/11971

to review the following change.


Change subject: build: don't instantiate const member with no user-defined constructor
......................................................................

build: don't instantiate const member with no user-defined constructor

It seems that some compilers disallow instantiating const objects that
don't provide a user-provided constructor. This would surface as the
following error.

error: default initialization of an object of const type 'const ClusterInfo' requires a user-provided default constructor

Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
---
M src/kudu/tools/rebalance_algo-test.cc
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/71/11971/1
-- 
To view, visit http://gerrit.cloudera.org:8080/11971
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
Gerrit-Change-Number: 11971
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>

[kudu-CR] build: don't instantiate const objects with no user-defined constructor

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/11971 )

Change subject: build: don't instantiate const objects with no user-defined constructor
......................................................................


Patch Set 3:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/11971/1/src/kudu/tools/rebalance_algo-test.cc
File src/kudu/tools/rebalance_algo-test.cc:

http://gerrit.cloudera.org:8080/#/c/11971/1/src/kudu/tools/rebalance_algo-test.cc@294
PS1, Line 294:  const ClusterInf
> It doesn't; that's actually the first thing I tried :/
Actually thinking about this more, I was curious why this was the case and tried it again. Seems it was PEBCAK before and I conflated issues.



-- 
To view, visit http://gerrit.cloudera.org:8080/11971
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
Gerrit-Change-Number: 11971
Gerrit-PatchSet: 3
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 21 Nov 2018 01:10:01 +0000
Gerrit-HasComments: Yes

[kudu-CR] build: don't instantiate const objects with no user-defined constructor

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/11971 )

Change subject: build: don't instantiate const objects with no user-defined constructor
......................................................................


Patch Set 3: Code-Review+2

(1 comment)

http://gerrit.cloudera.org:8080/#/c/11971/1/src/kudu/tools/rebalance_algo-test.cc
File src/kudu/tools/rebalance_algo-test.cc:

http://gerrit.cloudera.org:8080/#/c/11971/1/src/kudu/tools/rebalance_algo-test.cc@294
PS1, Line 294:  const ClusterInf
> Actually thinking about this more, I was curious why this was the case and 
Yep, that looked suspicious since at line 304 there is similar construct and it worked.  Thank you for looking at it again.



-- 
To view, visit http://gerrit.cloudera.org:8080/11971
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
Gerrit-Change-Number: 11971
Gerrit-PatchSet: 3
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 21 Nov 2018 03:56:00 +0000
Gerrit-HasComments: Yes

[kudu-CR] build: don't instantiate const objects with no user-defined constructor

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/11971 )

Change subject: build: don't instantiate const objects with no user-defined constructor
......................................................................

build: don't instantiate const objects with no user-defined constructor

It seems that some compilers disallow instantiating const objects that
don't provide a user-provided constructor. This would surface as the
following error.

error: default initialization of an object of const type 'const ClusterInfo' requires a user-provided default constructor

Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
Reviewed-on: http://gerrit.cloudera.org:8080/11971
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <as...@cloudera.com>
---
M src/kudu/tools/rebalance_algo-test.cc
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Kudu Jenkins: Verified
  Alexey Serbin: Looks good to me, approved

-- 
To view, visit http://gerrit.cloudera.org:8080/11971
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
Gerrit-Change-Number: 11971
Gerrit-PatchSet: 4
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] build: don't instantiate const objects with no user-defined constructor

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/11971 )

Change subject: build: don't instantiate const objects with no user-defined constructor
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/11971/1/src/kudu/tools/rebalance_algo-test.cc
File src/kudu/tools/rebalance_algo-test.cc:

http://gerrit.cloudera.org:8080/#/c/11971/1/src/kudu/tools/rebalance_algo-test.cc@294
PS1, Line 294:  ClusterInfo info
I'm curious whether the following (more idiomatic) would help here:

const Cluster info = {};


http://gerrit.cloudera.org:8080/#/c/11971/1/src/kudu/tools/rebalance_algo-test.cc@324
PS1, Line 324:   ClusterInfo info;
ditto



-- 
To view, visit http://gerrit.cloudera.org:8080/11971
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
Gerrit-Change-Number: 11971
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 21 Nov 2018 01:01:48 +0000
Gerrit-HasComments: Yes

[kudu-CR] build: don't instantiate const objects with no user-defined constructor

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, Kudu Jenkins, Adar Dembo, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/11971

to look at the new patch set (#2).

Change subject: build: don't instantiate const objects with no user-defined constructor
......................................................................

build: don't instantiate const objects with no user-defined constructor

It seems that some compilers disallow instantiating const objects that
don't provide a user-provided constructor. This would surface as the
following error.

error: default initialization of an object of const type 'const ClusterInfo' requires a user-provided default constructor

Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
---
M src/kudu/tools/rebalance_algo-test.cc
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/71/11971/2
-- 
To view, visit http://gerrit.cloudera.org:8080/11971
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
Gerrit-Change-Number: 11971
Gerrit-PatchSet: 2
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] build: don't instantiate const objects with no user-defined constructor

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/11971 )

Change subject: build: don't instantiate const objects with no user-defined constructor
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/11971/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/11971/1//COMMIT_MSG@7
PS1, Line 7: object
> It's not a class member though; it's just a local instantiation.
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/11971
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
Gerrit-Change-Number: 11971
Gerrit-PatchSet: 2
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 21 Nov 2018 01:02:01 +0000
Gerrit-HasComments: Yes

[kudu-CR] build: don't instantiate const objects with no user-defined constructor

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, Kudu Jenkins, Adar Dembo, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/11971

to look at the new patch set (#3).

Change subject: build: don't instantiate const objects with no user-defined constructor
......................................................................

build: don't instantiate const objects with no user-defined constructor

It seems that some compilers disallow instantiating const objects that
don't provide a user-provided constructor. This would surface as the
following error.

error: default initialization of an object of const type 'const ClusterInfo' requires a user-provided default constructor

Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
---
M src/kudu/tools/rebalance_algo-test.cc
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/71/11971/3
-- 
To view, visit http://gerrit.cloudera.org:8080/11971
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
Gerrit-Change-Number: 11971
Gerrit-PatchSet: 3
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] build: don't instantiate const member with no user-defined constructor

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/11971 )

Change subject: build: don't instantiate const member with no user-defined constructor
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/11971/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/11971/1//COMMIT_MSG@7
PS1, Line 7: member
It's not a class member though; it's just a local instantiation.



-- 
To view, visit http://gerrit.cloudera.org:8080/11971
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
Gerrit-Change-Number: 11971
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 21 Nov 2018 00:57:49 +0000
Gerrit-HasComments: Yes

[kudu-CR] build: don't instantiate const objects with no user-defined constructor

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/11971 )

Change subject: build: don't instantiate const objects with no user-defined constructor
......................................................................


Patch Set 2: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/11971
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
Gerrit-Change-Number: 11971
Gerrit-PatchSet: 2
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 21 Nov 2018 01:07:19 +0000
Gerrit-HasComments: No

[kudu-CR] build: don't instantiate const objects with no user-defined constructor

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/11971 )

Change subject: build: don't instantiate const objects with no user-defined constructor
......................................................................


Patch Set 2:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/11971/1/src/kudu/tools/rebalance_algo-test.cc
File src/kudu/tools/rebalance_algo-test.cc:

http://gerrit.cloudera.org:8080/#/c/11971/1/src/kudu/tools/rebalance_algo-test.cc@294
PS1, Line 294:  ClusterInfo info
> I'm curious whether the following (more idiomatic) would help here:
It doesn't; that's actually the first thing I tried :/


http://gerrit.cloudera.org:8080/#/c/11971/1/src/kudu/tools/rebalance_algo-test.cc@324
PS1, Line 324:   ClusterInfo info;
> ditto
Ack



-- 
To view, visit http://gerrit.cloudera.org:8080/11971
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
Gerrit-Change-Number: 11971
Gerrit-PatchSet: 2
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 21 Nov 2018 01:03:03 +0000
Gerrit-HasComments: Yes