http://llvm.org/bugs/show_bug.cgi?id=10107
Summary: Address of compound literal fails in gnu++0x but not
C99
Product: clang
Version: 2.9
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
The code below is C99 and supported by GCC in C++ mode since they allow
C99 features.
Clang accepts the code in C99 mode, it (correctly) says that compound
literals are a C99-specific feature in C++ mode, but with -std=gnu++0x
(which should support GCC extensions, i.e. C99) I get the following
error:
error: taking the address of a temporary object of type 'struct
point' [-Waddress-of-temporary]
----------8<----------
struct point { int x; int y; };
void draw_point (struct point const* aPoint) { }
int main (int argc, char const* argv[])
{
draw_point(&(struct point){ 1, 2 });
return 0;
}
--
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