[LLVMbugs] [Bug 9812] New: Incorrect error message on "bool signed"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 29 09:35:58 PDT 2011


           Summary: Incorrect error message on "bool signed"
           Product: clang
           Version: unspecified
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jonathan.sauer at gmx.de
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

The following (invalid) code which tries to declare a variable "signed" of type

int main(int, char**)
    bool    signed;

results in the following error message:

$ clang clang.cpp 
clang.cpp:3:7: error: '_Bool' cannot be signed or unsigned
        bool    signed;
clang.cpp:3:2: warning: declaration does not declare anything
        bool    signed;
1 warning and 1 error generated.

For some reason, the type displayed is "_Bool" instead of "bool".

My clang version:

$ clang --version
clang version 3.0 (trunk 130126)
Target: x86_64-apple-darwin10.7.0
Thread model: posix

I suspect the problem lies in DeclSpec#getSpecifierName, where the language
options are not checked when converting TST_bool into a name (contrary to

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list