diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-01-31 07:04:50 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-01-31 07:04:50 +0000 |
commit | 857dd066052e0883ca1f9da42883e9ab8367fb88 (patch) | |
tree | 1c1630150c6156ff7d5d5137594b5eebd89129e1 /clang/test/Sema/warn-shadow.c | |
parent | 819f610942163a1f17d507c202042138e48f3cc2 (diff) | |
download | bcm5719-llvm-857dd066052e0883ca1f9da42883e9ab8367fb88.tar.gz bcm5719-llvm-857dd066052e0883ca1f9da42883e9ab8367fb88.zip |
Fix the diagnostic when we are shadowing an external variable and there exists a locally scoped extern with the same name.
llvm-svn: 124580
Diffstat (limited to 'clang/test/Sema/warn-shadow.c')
-rw-r--r-- | clang/test/Sema/warn-shadow.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/test/Sema/warn-shadow.c b/clang/test/Sema/warn-shadow.c index c77bb0c450b..32aca8d612b 100644 --- a/clang/test/Sema/warn-shadow.c +++ b/clang/test/Sema/warn-shadow.c @@ -49,8 +49,13 @@ void test5(int i); void test6(void (*f)(int i)) {} void test7(void *context, void (*callback)(void *context)) {} +extern int bob; // expected-note {{previous declaration is here}} + // rdar://8883302 -extern int bob; void rdar8883302() { extern int bob; // don't warn for shadowing. } + +void test8() { + int bob; // expected-warning {{declaration shadows a variable in the global scope}} +} |