diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:02:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:02:28 +0000 |
commit | 7442d6faa2719e4e7d33a7021c406c5a4facd74d (patch) | |
tree | c72b9241553fc9966179aba84f90f17bfa9235c3 /test/Modules/merge-using-decls.cpp | |
parent | b52119637f743680a99710ce5fdb6646da2772af (diff) |
Diffstat (limited to 'test/Modules/merge-using-decls.cpp')
-rw-r--r-- | test/Modules/merge-using-decls.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Modules/merge-using-decls.cpp b/test/Modules/merge-using-decls.cpp index 98989d12f9855..1ec9a9a17bdee 100644 --- a/test/Modules/merge-using-decls.cpp +++ b/test/Modules/merge-using-decls.cpp @@ -1,6 +1,10 @@ // RUN: rm -rf %t // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x c++ -I%S/Inputs/merge-using-decls -verify %s -DORDER=1 +// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x c++ -I%S/Inputs/merge-using-decls -verify -std=c++98 %s -DORDER=1 +// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x c++ -I%S/Inputs/merge-using-decls -verify -std=c++11 %s -DORDER=1 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x c++ -I%S/Inputs/merge-using-decls -verify %s -DORDER=2 +// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x c++ -I%S/Inputs/merge-using-decls -verify -std=c++98 %s -DORDER=2 +// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x c++ -I%S/Inputs/merge-using-decls -verify -std=c++11 %s -DORDER=2 #if ORDER == 1 #include "a.h" @@ -24,7 +28,11 @@ template<typename T> int Use() { } template<typename T> int UseAll() { +#if __cplusplus <= 199711L // C++11 does not allow access declarations return Use<C<T> >() + Use<D<T> >() + Use<E<T> >() + Use<F<T> >(); // expected-note 0-2{{instantiation of}} +#else + return Use<C<T> >() + Use<D<T> >() + Use<F<T> >(); // expected-note 0-2{{instantiation of}} +#endif } template int UseAll<YA>(); @@ -37,8 +45,10 @@ template int UseAll<Y>(); // Here, we're instantiating the definition from 'A' and merging the definition // from 'B' into it. +#if __cplusplus <= 199711L // C++11 does not allow access declarations // expected-error@b.h:* {{'E::value' from module 'B' is not present in definition of 'E<T>' in module 'A'}} // expected-error@b.h:* {{'E::v' from module 'B' is not present in definition of 'E<T>' in module 'A'}} +#endif // expected-error@b.h:* {{'F::type' from module 'B' is not present in definition of 'F<T>' in module 'A'}} // expected-error@b.h:* {{'F::t' from module 'B' is not present in definition of 'F<T>' in module 'A'}} @@ -55,11 +65,14 @@ template int UseAll<Y>(); // expected-error@b.h:* 2{{'typename' keyword used on a non-type}} // expected-error@b.h:* 2{{dependent using declaration resolved to type without 'typename'}} +#if __cplusplus <= 199711L // C++11 does not allow access declarations // expected-error@a.h:* {{'E::type' from module 'A' is not present in definition of 'E<T>' in module 'B'}} // expected-error@a.h:* {{'E::t' from module 'A' is not present in definition of 'E<T>' in module 'B'}} // expected-error@a.h:* {{'E::value' from module 'A' is not present in definition of 'E<T>' in module 'B'}} // expected-error@a.h:* {{'E::v' from module 'A' is not present in definition of 'E<T>' in module 'B'}} // expected-note@b.h:* 2{{definition has no member}} +#endif + // expected-error@a.h:* {{'F::type' from module 'A' is not present in definition of 'F<T>' in module 'B'}} // expected-error@a.h:* {{'F::t' from module 'A' is not present in definition of 'F<T>' in module 'B'}} |