Created attachment 1395251[details]
Test case
Description of problem:
It seems gcc 8 is warning about some code that doesn't warn in gcc 7 and
which appears to be doing exactly what the warning says to do.
Specifically it warns that operator= should "return a reference to *this" which is exactly what it appears to be doing.
Version-Release number of selected component (if applicable):
gcc-c++-8.0.1-0.13.fc28.x86_64
Steps to Reproduce:
1. Compile attached test case with "g++ -Weffc++ -Werror -o reference reference.cpp"
Actual results:
reference.cpp:6:13: error: ‘operator=’ should return a reference to ‘*this’ [-Werror=effc++]
return *this;
^~~~
cc1plus: all warnings being treated as errors
Expected results:
No warning.
Additional info:
Found during mass rebuild of wagyu - have removed -Werror there so this isn't blocking anything.
(In reply to Tom Hughes from comment #0)
> Found during mass rebuild of wagyu - have removed -Werror there so this
> isn't blocking anything.
I'd also remove -Weffc++ unless the package specifically wants outdated advice from the 1990s.
Created attachment 1395251 [details] Test case Description of problem: It seems gcc 8 is warning about some code that doesn't warn in gcc 7 and which appears to be doing exactly what the warning says to do. Specifically it warns that operator= should "return a reference to *this" which is exactly what it appears to be doing. Version-Release number of selected component (if applicable): gcc-c++-8.0.1-0.13.fc28.x86_64 Steps to Reproduce: 1. Compile attached test case with "g++ -Weffc++ -Werror -o reference reference.cpp" Actual results: reference.cpp:6:13: error: ‘operator=’ should return a reference to ‘*this’ [-Werror=effc++] return *this; ^~~~ cc1plus: all warnings being treated as errors Expected results: No warning. Additional info: Found during mass rebuild of wagyu - have removed -Werror there so this isn't blocking anything.