diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-05 01:11:47 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-05 01:11:47 +0000 |
commit | 447af24a003aa8d0dc7317a56f06f5b8361f8808 (patch) | |
tree | 7c1662e63b5c2419ec98b5b8eb49c31a12c6681a /test | |
parent | 79430e9983f5e67a378fc1f50cd6278f2cea8259 (diff) |
When we're performing name lookup for a tag, we still allow ourselves
to see hidden declarations because every tag lookup is effectively a
redeclaration lookup. For example, image that
struct foo;
is declared in a submodule that is known but hasn't been imported. If
someone later writes
struct foo *foo_p;
then "struct foo" is either a reference or a redeclaration. To keep
the redeclaration chains sound, we treat it like a redeclaration for
name-lookup purposes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147588 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Modules/Inputs/redecl-merge-top-explicit.h | 2 | ||||
-rw-r--r-- | test/Modules/redecl-merge.m | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/test/Modules/Inputs/redecl-merge-top-explicit.h b/test/Modules/Inputs/redecl-merge-top-explicit.h index 54aab33e6c..e06ff7aeda 100644 --- a/test/Modules/Inputs/redecl-merge-top-explicit.h +++ b/test/Modules/Inputs/redecl-merge-top-explicit.h @@ -5,3 +5,5 @@ int *explicit_func(void); struct explicit_struct { int member; }; #define ONE 1 + +typedef struct my_struct_type *my_struct_ref; diff --git a/test/Modules/redecl-merge.m b/test/Modules/redecl-merge.m index b41986609c..09898a5b3b 100644 --- a/test/Modules/redecl-merge.m +++ b/test/Modules/redecl-merge.m @@ -1,11 +1,11 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -I %S/Inputs %s -verify +// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -Wno-typedef-redefinition -I %S/Inputs %s -verify // RUN: %clang_cc1 -x objective-c++ -fmodules -fmodule-cache-path %t -I %S/Inputs %s -verify @class C2; @class C3; @class C3; @import redecl_merge_left; - +typedef struct my_struct_type *my_struct_ref; @protocol P4; @class C3; @class C3; |