http://llvm.org/bugs/show_bug.cgi?id=13808
Bug #: 13808
Summary: -Wdangling-field warning should check in-class
initializers
Product: clang
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++11
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
struct S { const int &a; S() : a(0) {} } s;
struct T { const int &a = 0; } t;
produces:
<stdin>:1:34: warning: binding reference member 'a' to a temporary value
[-Wdangling-field]
struct S { const int &a; S() : a(0) {} } s;
^
<stdin>:1:23: note: reference member declared here
struct S { const int &a; S() : a(0) {} } s;
^
We should also issue a diagnostic for the in-class initializer case.
--
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