[LLVMbugs] [Bug 12770] New: declaration conflicts for extern "C" function
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue May 8 23:47:07 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=12770
Bug #: 12770
Summary: declaration conflicts for extern "C" function
Product: new-bugs
Version: 3.0
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: sbn at tbricks.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
The following code is accepted by g++ (4.2.1 on MacOSX, 4.5.1, 4.7.0 on
Solaris, 4.1.2, 3.4.6, 4.4.4 on Linux) and Sun C++ 5.11 on Solaris, but
rejected by clang (3.0 on MacOSX and TOT on Solaris):
$ cat -n b.cpp
1 extern "C" {
2
3 namespace std {
4 int rename(const char *, const char *);
5 }
6
7 }
8
9 using std::rename;
10
11 extern "C" int rename(const char *, const char *);
$ clang++ -c b.cpp
b.cpp:11:16: error: declaration conflicts with target of using declaration
already in scope
extern "C" int rename(const char *, const char *);
^
b.cpp:4:5: note: target of using declaration
int rename(const char *, const char *);
^
b.cpp:9:12: note: using declaration
using std::rename;
^
1 error generated.
$ clang++ -v
Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin11.2.0
Thread model: posix
--
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