http://llvm.org/bugs/show_bug.cgi?id=22404
Bug ID: 22404
Summary: Base class init error
Product: clang
Version: 3.5
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Clang 3.5.1 fails to compile this code:
#include<sys/stat.h>
struct file_stat : public ::stat
{
file_stat(const struct ::stat &s) : ::stat(s) {}
};
int main()
{
struct ::stat s;
file_stat s2(s);
}
with error:
clang-bug.cpp:5:43: error: member initializer 'stat' does not name a non-static
data member or base class
file_stat(const struct ::stat &s) : ::stat(s) {}
^~~~~~~
GCC accepts this code silently. This workaround works for Clang:
struct file_stat : public ::stat
{
typedef struct ::stat base;
file_stat(const struct ::stat &s) : base(s) {}
};
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs