[Bug c++/61012] New: lto1: errors during merging of translation units (error:=?UTF-8?Q?=20variable=20=E2=80=98link=E2=80=99=20redeclared=20as=20function?=)
mliska at suse dot cz
gcc-bugzilla@gcc.gnu.org
Wed Apr 30 11:19:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61012
Bug ID: 61012
Summary: lto1: errors during merging of translation units
(error: variable ‘link’ redeclared as function)
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mliska at suse dot cz
$ cat a.c
struct s
{
int a;
int b;
};
static struct s link = { 1, 2 };
int foo()
{
return link.a;
}
$ cat b.c
#include <unistd.h>
int main()
{
int r = link("aaa", "bbb");
return foo();
}
$ gcc a.c b.c -flto -O2
/usr/include/unistd.h:812:12: error: variable ‘link’ redeclared as function
extern int link (const char *__from, const char *__to)
^
a.c:7:17: note: previously declared here
static struct s link = { 1, 2 };
^
lto1: fatal error: errors during merging of translation units
compilation terminated.
lto-wrapper: gcc returned 1 exit status
/home/marxin/Programming/bin/gcc2/lib64/gcc/x86_64-unknown-linux-gnu/4.10.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
fatal error: lto-wrapper failed
collect2: error: ld returned 1 exit status
More information about the Gcc-bugs
mailing list