[cfe-dev] request for help understanding a traceback

Christopher Jefferson chris at bubblescope.net
Thu Feb 18 07:11:09 PST 2010


On 18 Feb 2010, at 15:06, R P Herrold wrote:

> 
> I see the following from a run report attachment
> ( full run report on another matter at:
> 	http://llvm.org/bugs/show_bug.cgi?id=6344 )
> 
> [ side matter: ... I am not so sure about the 'deprecated' 
> asserted -- standard reference so stating please?  but thanks 
> for the fix ;) ]
> 
> 
> /usr/bin/clang++ -Wall     -g -I/usr/include/mysql
> 	-I/usr/include/c++/4.1.1/ -I/
> 	usr/include/c++/4.1.1/x86_64-redhat-linux  -c -o obj/bind.o
> 	src/bind.c
> clang: warning: treating 'c' input as 'c++' when in C++ mode,
> 	this behavior is deprecated
> In file included from src/main.c:8:
> In file included from src/main-h.h:11:
> In file included from src/glossary.h:18:
> In file included from src/../lib/glossary.h:46:
> src/../lib/exceptions.h:23:1: warning: struct  'out_of_range'
> 	was previously declared as a class  [-Wmismatched-tags]
> struct out_of_range {
> ^~~~~~
> class
> In file included from src/main.c:8:
> In file included from src/main-h.h:11:
> In file included from src/glossary.h:18:
> In file included from src/../lib/glossary.h:32:
> src/../lib/type_names.h:19:47: note: previous use is here
>                                         class out_of_range;
>                                               ^

The problem is that you should consistently either call a type a struct, or a class.

You write:
> 
> 
> namespace MinimalModeMultiParadigm {
> 
> ...
> 
> struct out_of_range {
...
>     
> src/../lib/type_names.h
> ------------------
> 
> namespace MinimalModeMultiParadigm {
...
> 
>                                         class out_of_range;
...

Notice how MinimalModeMultiParadigm::out_of_range is defined as a class in one place, and a struct in the other. While these two are basically equivalent in C++, you are being warned that you are being inconsistent. Change either both to a struct, or both to a class. It is probably easier to change the one in type_names.h, as changing the other will effect members in the object.

Does that help?

Chris



More information about the cfe-dev mailing list