diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-08-13 18:18:50 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-08-13 18:18:50 +0000 |
| commit | 1c34fb78e7ebb9956c4282a5247a949869e6c09c (patch) | |
| tree | e0bbcc06c58ed3c975834e73b00bb4b053f80f94 /clang/test/PCH/cxx-templates.h | |
| parent | c8d710cc82ee56cc59fb9b378b44623dcc53fd15 (diff) | |
| download | bcm5719-llvm-1c34fb78e7ebb9956c4282a5247a949869e6c09c.tar.gz bcm5719-llvm-1c34fb78e7ebb9956c4282a5247a949869e6c09c.zip | |
Fix implementation of C11 6.2.7/4 and C++11 [dcl.array]p3:
When a local extern declaration redeclares some other entity, the type of that
entity is merged with the prior type if the prior declaration is visible (in C)
or is declared in the same scope (in C++).
- Make LookupRedeclarationWithLinkage actually work in C++, use it in the right
set of cases, and make it track whether it found a shadowed declaration.
- Track whether we found a declaration in the same scope (for C++) including
across serialization and template instantiation.
llvm-svn: 188307
Diffstat (limited to 'clang/test/PCH/cxx-templates.h')
| -rw-r--r-- | clang/test/PCH/cxx-templates.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/PCH/cxx-templates.h b/clang/test/PCH/cxx-templates.h index ce6b7051ecc..992f478e33e 100644 --- a/clang/test/PCH/cxx-templates.h +++ b/clang/test/PCH/cxx-templates.h @@ -296,3 +296,18 @@ namespace cyclic_module_load { }; } } + +namespace local_extern { + template<typename T> int f() { + extern int arr[3]; + { + extern T arr; + return sizeof(arr); + } + } + template<typename T> int g() { + extern int arr[3]; + extern T arr; + return sizeof(arr); + } +} |

