[SERVER-65851] Remove concept of is_const_type from idl generator Created: 20/Apr/22  Updated: 29/Apr/22  Resolved: 29/Apr/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Daniel Moody Assignee: Billy Donahue
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-58110 IDL: getters sometimes have const val... Closed
Related
is related to SERVER-65278 fix clang-tidy v4 issues and add v4 c... Closed
Participants:

 Description   

In SERVER-65278 we are using the latest clang-tidy which is removing a lot of case where we have a const return type in many declarations. The idl generator has some specific code around this that could be simplified now that we intend to not use const type in the return for types which are not const ref.

'const_type': 'const ' if cpp_type_info.is_const_type() else '',
// to
'const_type': 'const ' if '&' in param_type else '', 

 



 Comments   
Comment by Billy Donahue [ 21/Apr/22 ]

The fix proposed in the description is insufficient (finding a `&` character somewhere in a type's name doesn't mean it's a reference type), but I agree with this ticket's premise. I reported SERVER-58110 a while back and marked this a duplicate of that.

Generated at Thu Feb 08 06:03:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.