Bug 363540

Summary: detaching-member false positive if non-const reference is stored
Product: [Developer tools] clazy Reporter: Nyall Dawson <nyall.dawson>
Component: generalAssignee: Unassigned bugs <unassigned-bugs-null>
Status: RESOLVED WAITINGFORINFO    
Severity: normal CC: smartins
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Nyall Dawson 2016-05-26 10:52:01 UTC
The detaching-member test incorrectly flags the following code:

my_class &obj = list[index];
obj.someNonConstMember( 5 );
obj.someOtherNonConstMember( 10 );

Ideally the test would detect that the returned value is being stored in a non-const reference and not throw the warning.

Reproducible: Always
Comment 1 Sergio Martins 2016-05-26 14:56:21 UTC
can you attach a compilable test-case ?

thanks
Comment 2 Sergio Martins 2016-06-25 12:20:37 UTC
ping ? I can't reproduce this