This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] Be in language c more c++ compatible
On Sat, 23 Jul 2011 20:38:11 +0200, Mark Kettenis wrote:
> > echo 'class C { typedef int t; t i; } c;'|g++ -c -o 1.o -g -x c++ -
>
> Isn't that a GCC bug? I mean, if code is compiled with the C++
> compiler it should be tagged as such in the debug info shouldn't it?
I take the point that in these cases only a single CU is loaded. While
currently GDB does not consider such CU for language detection (such as
because it does not contain `main') one possible fix is to just follow the CU
language, if it is the only CU loaded.
> > The first (c-exp.y) part parses those parts of `language c++' which cannot
> > (I believe - RFC) lead to misinterpretation of any valid C code even in
> > `language c'.
>
> I think this is a bad idea.
There was another mail about use case when you combine C/C++ application/libs.
What are disadvantages of interpreting something as C++ instead of giving
error on such expression?
Thanks,
Jan