http://llvm.org/bugs/show_bug.cgi?id=8674
Summary: bewildering error message: cannot initialize a
parameter of type 'struct stat *' with an rvalue of
type 'struct stat *'
Product: clang
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
I got this today (where 'baz' was 'stat', renamed to be a little less
confusing):
t.cc:14:16: error: cannot initialize a parameter of type 'struct stat *' with
an
rvalue of type 'struct stat *'
::baz("foo", &X);
^~
t.cc:10:36: note: passing argument to parameter here
void baz(const char*, struct stat *);
^
This is incredibly confusing and took me a long time to figure out what was
going wrong. Here's the reduced input:
namespace clang {
class foo {
void bar(struct stat &X);
};
}
struct stat;
void baz(const char*, struct stat *);
using namespace clang;
void foo::bar(struct stat &X) {
::baz("foo", &X);
}
--
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs