https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88471
Bug ID: 88471
Summary: GCC suggests variables that are not of the right type
Product: gcc
Version: 8.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jg at jguk dot org
Target Milestone: ---
GCC suggests variables that are not of the right type. 'rename' is actually
function, so wouldn't be assigned to an int.
$ g++-8 -Wall -o name name.cpp
name.cpp: In function ‘int main()’:
name.cpp:6:13: error: ‘name’ was not declared in this scope
int v = name;
^~~~
name.cpp:6:13: note: suggested alternative: ‘rename’
int v = name;
^~~~
rename
$
// g++-8 -Wall -o name name.cpp
#include <cstdio>
int main()
{
int v = name;
return v;
}