https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52523
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |msebor at gcc dot gnu.org
Status|NEW |RESOLVED
Keywords| |diagnostic
Resolution|--- |FIXED
Target Milestone|--- |11.0
Known to fail| |10.2.0, 4.7.0, 4.8.4,
| |4.9.4, 5.5.0, 6.4.0, 7.2.0,
| |8.3.0, 9.1.0
--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
GCC 11 (since g:b825a22890740f341eae566af27e18e528cd29a7) diagnoses passing an
uninitialized object by const reference by -Wmaybe-uninitialized:
$ g++ -S -Wall pr52523.C
pr52523.C: In function ‘int main()’:
pr52523.C:6:13: warning: ‘x’ is used uninitialized [-Wuninitialized]
6 | std::cout << x;
| ~~~~~~~~~~^~~~
pr52523.C:5:7: note: ‘x’ declared here
5 | int x;
| ^