mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-30 02:26:07 +00:00

This fixes pr17624. A FIXME from Richard Smith: It seems to me that the root cause is that a per-Decl 'used' flag doesn't really make much sense in the way we use it now. I think we should either track whether that particular declaration is used (with isUsed scanning the entire redecl chain), or we should only have one flag for the entire redeclaration chain (perhaps by always looking at the flag on either the most recent decl or the canonical decl). Modeling it as "is this declaration or any previous declaration used" is weird, and requires contortions like the loop at the end of Sema::MarkFunctionReferenced. llvm-svn: 193202
10 lines
148 B
C
10 lines
148 B
C
// RUN: %clang_cc1 -fsyntax-only -verify -Wall %s
|
|
// expected-no-diagnostics
|
|
|
|
static int a;
|
|
int bar() {
|
|
extern int a;
|
|
return a;
|
|
}
|
|
static int a;
|