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: Paul Pluzhnikov
Subject: Re: g++ 4.3.2-4 problem with typeof
Date: Thu, 09 Oct 2008 22:34:12 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

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).

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

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

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

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