http://llvm.org/bugs/show_bug.cgi?id=12006
Bug #: 12006
Summary: Local const int cannot be used as an array bound in
local struct
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++0x
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
void f() {
const int i = 5;
struct S {
int a[i];
};
}
$ clang -std=c++11 -fsyntax-only test.cc
test.cc:4:11: error: reference to local variable 'i' declared in enclosing
function 'f'
int a[i];
^
test.cc:2:13: note: 'i' declared here
const int i = 5;
^
According to dgregor, "C++11 [class.local]p1 says it's valid code."
--
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