diff options
Diffstat (limited to 'clang/test/Modules/Inputs')
| -rw-r--r-- | clang/test/Modules/Inputs/cxx-templates-common.h | 7 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/module.map | 1 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/redecl-add-after-load-decls.h | 24 |
3 files changed, 32 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/cxx-templates-common.h b/clang/test/Modules/Inputs/cxx-templates-common.h index efbda2bd256..4a10e358805 100644 --- a/clang/test/Modules/Inputs/cxx-templates-common.h +++ b/clang/test/Modules/Inputs/cxx-templates-common.h @@ -23,3 +23,10 @@ namespace Std { } template<typename T> struct TemplateInstantiationVisibility { typedef int type; }; + +template<typename T> struct Outer { + template<typename U> struct Inner { + void f(); + void g(); + }; +}; diff --git a/clang/test/Modules/Inputs/module.map b/clang/test/Modules/Inputs/module.map index 061abbd24d5..a85145f8711 100644 --- a/clang/test/Modules/Inputs/module.map +++ b/clang/test/Modules/Inputs/module.map @@ -70,6 +70,7 @@ module redeclarations_right { header "redeclarations_right.h" } module redecl_namespaces_left { header "redecl_namespaces_left.h" } module redecl_namespaces_right { header "redecl_namespaces_right.h" } module redecl_add_after_load_top { header "redecl-add-after-load-top.h" } +module redecl_add_after_load_decls { header "redecl-add-after-load-decls.h" } module redecl_add_after_load { header "redecl-add-after-load.h" } module load_failure { header "load_failure.h" } diff --git a/clang/test/Modules/Inputs/redecl-add-after-load-decls.h b/clang/test/Modules/Inputs/redecl-add-after-load-decls.h new file mode 100644 index 00000000000..fbe6b9387a1 --- /dev/null +++ b/clang/test/Modules/Inputs/redecl-add-after-load-decls.h @@ -0,0 +1,24 @@ +typedef struct A B; +extern const int variable; +extern constexpr int function(); +constexpr int test(bool b) { return b ? variable : function(); } + +namespace N { + typedef struct A B; + extern const int variable; + extern constexpr int function(); +} +typedef N::B NB; +constexpr int N_test(bool b) { return b ? N::variable : N::function(); } + +@import redecl_add_after_load_top; +typedef C::A CB; +constexpr int C_test(bool b) { return b ? C::variable : C::function(); } + +struct D { + struct A; // expected-note {{forward}} + static const int variable; + static constexpr int function(); // expected-note {{here}} +}; +typedef D::A DB; +constexpr int D_test(bool b) { return b ? D::variable : D::function(); } // expected-note {{subexpression}} expected-note {{undefined}} |

