help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: g++ 4.3.2-4 problem with typeof


From: anon
Subject: Re: g++ 4.3.2-4 problem with typeof
Date: Fri, 10 Oct 2008 10:18:23 +0200
User-agent: Thunderbird 2.0.0.12 (X11/20080226)

Paul Pluzhnikov wrote:
anon <anon@no.invalid> writes:

I am trying to upgrade the compiler from 4.1.3 to 4.3.2, and I am
getting next errors:
filename.cpp: line number: sorry, unimplemented: mangling typeof, use
decltype instead
What I find strange, is why it doesn't happen with g++ 4.1.3

Sounds like a gcc bug.

I have this in several files, and the line number is always the last
line in the file. In these files, typeof is not used. By the way, it
wasn't me who wrote these files.

Since the project is big, I have no idea where to start looking and I
can not write an example that demonstrates this.

Can anyone help to solve this problem? Or at least to suggest how to
proceed?

There are two general ways you can proceed:
- build a copy of gcc-4.3.2 with debug info, set a breakpoint on
  the gcc error routine, and examine data which caused it fire, or
- create preprocessed file using g++ -E -I... -D... problem-source.cc > problem.ii
  then try to remove parts of problem.ii which do not cause the
  problem to disappear.

The first method likely requires more understanding of GCC internals
than you can reasonably get in a couple of days, and the second
method is very labor intensive, but often produces a test case of
just 10 lines. There is also some automation you can use (look
for delta debugging, e.g. here:
http://sourceware.org/ml/crossgcc/2005-08/msg00024.html).

Great. Thanks for the link


However, searching for your exact error message comes up with
several GCC bugs related to using 'typeof' in template parameters,
with resolution of "don't do that, use decltype instead".
Here is one: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11756


I found same bug reports (there aren't many), but we are not using typeof anywhere (cpp or hpp).

Perhaps 'grep typeof *.h' will reveal that you are using that
construct? If so, fix it to use decltype instead.

Cheers,

Thank you for the reply.

My colleague suggested it might be something related to boost, and turned out he was right. The boost version installed was 1.34, and in 1.36 they fixed this issue. Strange thing is that I tried the build on fedora 10, which should have all libraries up to date with the latest release.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]