http://llvm.org/bugs/show_bug.cgi?id=4389
Summary: clang: wrong scoping: refuses to compile global variable
name same as local variable name
Product: clang
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Semantic Analyzer
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Blocks: 4068
$ clang testcase-min.i
testcase-min.i:4:12: error: redefinition of 'index' as different kind of symbol
static int index[8];
^
testcase-min.i:2:9: note: previous definition is here
int index = bar();
^
2 diagnostics generated.
testcase-min.i:
static void foo () {
int index = bar();
}
static int index[8];
gcc compiles this code fine, and if I move the 'static int index[8]' before
foo(), then clang compiles it as well.
Why does clang still see the definition of the local index variable at the time
the global index variable is defined?
--
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