[cfe-dev] error: cannot combine with previous 'type-name' declaration specifier

Douglas Gregor dgregor at apple.com
Mon Jan 11 12:53:01 PST 2010


On Jan 11, 2010, at 12:44 PM, Sascha Wildner wrote:

> Hi,
>
> encouraged by the recent improvement in clang's C++ support, I tried
> building DragonFly's devd(8) with it but am getting:
>
> clang -fno-color-diagnostics   -O -pipe  -I.
> -I/home/s/projects/dragonfly/src/sbin/devd  -g  -c devd.cc
> In file included from devd.cc:59:
> In file included from /usr/include/c++/4.1/algorithm:64:
> In file included from /usr/include/c++/4.1/bits/stl_algobase.h:69:
> In file included from /usr/include/c++/4.1/iosfwd:48:
> In file included from /usr/include/c++/4.1/bits/postypes.h:45:
> In file included from /usr/include/c++/4.1/cwchar:54:
> /usr/include/wchar.h:78:19: error: cannot combine with previous
> 'type-name' declaration specifier
> typedef __wchar_t       wchar_t;
>                         ^
> /usr/include/wchar.h:78:1: error: declaration does not declare  
> anything
> typedef __wchar_t       wchar_t;
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 2 diagnostics generated.
> *** Error code 1
>
> But what is the problem here?


The wchar.h header looks suspicious. wchar_t is a built-in type in C+ 
+, and cannot be a typedef.  Somehow, your wchar.h should protect  
against defining wchar_t when in C++ mode. I suggest looking through / 
usr/include/wchar.h to determine which preprocessor macros control  
that definition.

	- Doug



More information about the cfe-dev mailing list