-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed as not planned
Closed as not planned
Copy link
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.wontfixIssue is real, but we can't or won't fix it. Not invalidIssue is real, but we can't or won't fix it. Not invalid
Description
The following (very contrived) program shows a program that is accepted when the g++ headers are used, but not when the libc++ headers are used.
Not sure if this is a bug in libc++, but it can pose a porting issue. Any comments are welcome.
Thanks so much,
Ed Vogel
Here is the reproducer from a cygwin session:
$ cat b1.cpp
#include <functional>
#include <stddef.h>
using namespace std;
struct sockaddr {
int a;
int b;
};
extern "C" {
int bind (int, const struct sockaddr *, size_t);
}
void f (void) {
int sock2;
sock2 = bind(sock2, (struct sockaddr *)&sock2, sizeof(sock2));
}
VogelEd@XLB3502Q4E ~
$ clang -c b1.cpp
VogelEd@XLB3502Q4E ~
$ clang -c -stdlib=libc++ b1.cpp
b1.cpp:13:11: error: assigning to 'int' from incompatible type '__bind<int &,
sockaddr *, unsigned long>'
sock2 = bind(sock2, (struct sockaddr *)&sock2, sizeof(sock2));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Note that if there is no assignment of the return value, the program compiles.
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.wontfixIssue is real, but we can't or won't fix it. Not invalidIssue is real, but we can't or won't fix it. Not invalid