[LLVMbugs] [Bug 10158] New: clang fails to compile binutils gold

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jun 19 13:22:09 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10158

           Summary: clang fails to compile binutils gold
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ismail at namtrac.org
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


While trying to compile binutils gold with clang, I encountered the following
problematic C++ code:

[~]> cat script.ii 
namespace gold
{
extern "C" {
extern void
yyerror(void* closure, const char*);
};
}
using namespace gold;
extern "C" void
yyerror(void* closurev, const char* message)
{
}
extern "C" struct Version_expression_list*
version_script_push_lang(void* closurev, const char* lang, int langlen)
{
    {
      char* buf = new char[langlen + 100];
      yyerror(closurev, buf);
    }
}

[~]> clang++ -c script.ii 
script.ii:18:7: error: call to 'yyerror' is ambiguous
      yyerror(closurev, buf);
      ^~~~~~~
script.ii:5:1: note: candidate function
yyerror(void* closure, const char*);
^
script.ii:10:1: note: candidate function
yyerror(void* closurev, const char* message)
^
1 error generated.

Where as gcc does not complain:

[~]> g++ -c script.ii 
[~]>

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