Bug #42905
closedClang compiler Generates errors on using a reference in a Lambda function
0%
Description
Probably because of the possible introduction of modules in C++20
Which perhaps is not going to make the standard.
Best to keep clear of it.
In file included from /home/jenkins/workspace/ceph-master/src/mgr/ActivePyModules.cc:22:
In file included from /home/jenkins/workspace/ceph-master/src/osd/OSDMap.h:37:
In file included from /home/jenkins/workspace/ceph-master/src/osd/osd_types.h:48:
In file included from /home/jenkins/workspace/ceph-master/src/osd/Watch.h:19:
In file included from /home/jenkins/workspace/ceph-master/src/include/Context.h:29:
/home/jenkins/workspace/ceph-master/src/common/error_code.h:28:7: warning: 'ceph::converting_category' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
class converting_category : public boost::system::error_category {
^
/home/jenkins/workspace/ceph-master/src/mgr/ActivePyModules.cc:483:39: error: 'module' in capture list does not name a variable
finisher.queue(new LambdaContext([module, notify_type, notify_id](int r){
^
/home/jenkins/workspace/ceph-master/src/mgr/ActivePyModules.cc:484:7: error: reference to local binding 'module' declared in enclosing function 'ActivePyModules::notify_all'
module->notify(notify_type, notify_id);
^
/home/jenkins/workspace/ceph-master/src/mgr/ActivePyModules.cc:479:21: note: 'module' declared here
for (auto& [name, module] : modules) {
^
/home/jenkins/workspace/ceph-master/src/mgr/ActivePyModules.cc:502:39: error: 'module' in capture list does not name a variable
finisher.queue(new LambdaContext([module, log_entry](int r){
^
/home/jenkins/workspace/ceph-master/src/mgr/ActivePyModules.cc:503:7: error: reference to local binding 'module' declared in enclosing function 'ActivePyModules::notify_all'
module->notify_clog(log_entry);
^
/home/jenkins/workspace/ceph-master/src/mgr/ActivePyModules.cc:494:21: note: 'module' declared here
for (auto& [name, module] : modules) {
^
/home/jenkins/workspace/ceph-master/src/mgr/ActivePyModules.cc:994:39: error: 'module' in capture list does not name a variable
finisher.queue(new LambdaContext([module](int r){
^
/home/jenkins/workspace/ceph-master/src/mgr/ActivePyModules.cc:995:7: error: reference to local binding 'module' declared in enclosing function 'ActivePyModules::config_notify'
module->config_notify();
^
/home/jenkins/workspace/ceph-master/src/mgr/ActivePyModules.cc:990:21: note: 'module' declared here
for (auto& [name, module] : modules) {
^
1 warning and 6 errors generated.
Updated by Willem Jan Withagen over 4 years ago
Willem Jan Withagen wrote:
Probably because of the possible introduction of modules in C++20
Which perhaps is not going to make the standard.
Best to keep clear of it.
Turns out to be:
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2313
Updated by Jan Fajerski over 4 years ago
- Project changed from ceph-volume to devops
Updated by Willem Jan Withagen over 4 years ago
- Subject changed from Clang compiler dos not like the use of modules as variable name to Clang compiler Generates errors on using a reference in a Lambda function
Updated by Kefu Chai over 4 years ago
- Project changed from devops to mgr
- Status changed from New to Fix Under Review
- Assignee set to Willem Jan Withagen
- Target version deleted (
v15.0.0)
Updated by Kefu Chai over 4 years ago
- Status changed from Fix Under Review to Resolved