diff options
| author | Douglas Gregor <dgregor@apple.com> | 2011-12-20 18:11:52 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2011-12-20 18:11:52 +0000 |
| commit | 21823bfe318a02a73f96e05c368211b640f6bc53 (patch) | |
| tree | 24b3d01c99ad5d6f4085defcdc657a8eb032dddf /clang/test/Modules/Inputs/module_private_left.h | |
| parent | 9735fc9abd19b13ae521c6c29be043da74e93d0d (diff) | |
| download | bcm5719-llvm-21823bfe318a02a73f96e05c368211b640f6bc53.tar.gz bcm5719-llvm-21823bfe318a02a73f96e05c368211b640f6bc53.zip | |
When performing name lookup for a redeclaration, ignore module
visibility restrictions. This ensures that all declarations of the
same entity end up in the same redeclaration chain, even if some of
those declarations aren't visible. While this may seem unfortunate to
some---why can't two C modules have different functions named
'f'?---it's an acknowedgment that a module does not introduce a new
"namespace" of names.
As part of this, stop merging the 'module-private' bit from previous
declarations to later declarations, because we want each declaration
in a module to stand on its own because this can effect, for example,
submodule visibility.
Note that this notion of names that are invisible to normal name
lookup but are available for redeclaration lookups is how we should
implement friend declarations and extern declarations within local
function scopes. I'm not tackling that problem now.
llvm-svn: 146980
Diffstat (limited to 'clang/test/Modules/Inputs/module_private_left.h')
| -rw-r--r-- | clang/test/Modules/Inputs/module_private_left.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/test/Modules/Inputs/module_private_left.h b/clang/test/Modules/Inputs/module_private_left.h index 617a7abf3d9..ff33999d0fb 100644 --- a/clang/test/Modules/Inputs/module_private_left.h +++ b/clang/test/Modules/Inputs/module_private_left.h @@ -1,6 +1,6 @@ __module_private__ struct HiddenStruct; -struct HiddenStruct { +__module_private__ struct HiddenStruct { }; @@ -10,17 +10,17 @@ template<typename T> __module_private__ void f1(T*); template<typename T> -void f1(T*); +__module_private__ void f1(T*); template<typename T> __module_private__ class vector; template<typename T> -class vector { +__module_private__ class vector { }; vector<float> vec_float; typedef __module_private__ int Integer; -typedef int Integer; +typedef __module_private__ int Integer; |

