[Bug c++/66934] Compiler accepting ill-formed program with extern variable declarations and using-declaration
anders.granlund.0 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jul 27 01:15:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66934
--- Comment #4 from Anders Granlund <anders.granlund.0 at gmail dot com> ---
I'm pulling in this test case from my related bug report.
int x = 1;
int main() {
extern int x;
using ::x;
}
I this case the program is well-formed (the two declarations in main are not
conflicting), but error messages are still given:
prog.cc: In function 'int main()':
prog.cc:5:13: error: redeclaration of 'int x'
using ::x;
^
prog.cc:4:16: note: previous declaration 'int x'
extern int x;
^
More information about the Gcc-bugs
mailing list