2013-06-24 12:45:28 +08:00
|
|
|
// RUN: rm -rf %t
|
2016-06-10 06:39:20 +08:00
|
|
|
// RUN: not %clang_cc1 -x objective-c++ -fmodules -fimplicit-module-maps -fno-modules-error-recovery -fmodules-cache-path=%t -I %S/Inputs %s -std=c++14 -ast-dump-lookups 2>/dev/null | FileCheck %s --check-prefix=CHECK-GLOBAL
|
|
|
|
// RUN: not %clang_cc1 -x objective-c++ -fmodules -fimplicit-module-maps -fno-modules-error-recovery -fmodules-cache-path=%t -I %S/Inputs %s -std=c++14 -ast-dump-lookups -ast-dump-filter N 2>/dev/null | FileCheck %s --check-prefix=CHECK-NAMESPACE-N
|
|
|
|
// RUN: not %clang_cc1 -x objective-c++ -fmodules -fimplicit-module-maps -fno-modules-error-recovery -fmodules-cache-path=%t -I %S/Inputs %s -std=c++14 -ast-dump -ast-dump-filter SomeTemplate 2>/dev/null | FileCheck %s --check-prefix=CHECK-DUMP
|
2016-05-05 08:56:12 +08:00
|
|
|
// RUN: %clang_cc1 -x objective-c++ -fmodules -fimplicit-module-maps -fno-modules-error-recovery -fmodules-cache-path=%t -I %S/Inputs %s -verify -std=c++14
|
|
|
|
// RUN: %clang_cc1 -x objective-c++ -fmodules -fimplicit-module-maps -fno-modules-error-recovery -fmodules-cache-path=%t -I %S/Inputs %s -verify -std=c++14 -DEARLY_IMPORT
|
2014-08-23 08:49:01 +08:00
|
|
|
|
|
|
|
#ifdef EARLY_IMPORT
|
|
|
|
#include "cxx-templates-textual.h"
|
|
|
|
#endif
|
2013-06-24 12:45:28 +08:00
|
|
|
|
|
|
|
@import cxx_templates_a;
|
|
|
|
@import cxx_templates_b;
|
2013-10-16 07:19:58 +08:00
|
|
|
@import cxx_templates_c;
|
2014-08-28 13:44:07 +08:00
|
|
|
@import cxx_templates_d;
|
2013-10-16 06:02:41 +08:00
|
|
|
@import cxx_templates_common;
|
2013-06-24 12:45:28 +08:00
|
|
|
|
2013-06-25 06:51:00 +08:00
|
|
|
template<typename, char> struct Tmpl_T_C {};
|
|
|
|
template<typename, int, int> struct Tmpl_T_I_I {};
|
|
|
|
|
|
|
|
template<typename A, typename B, A> struct Tmpl_T_T_A {};
|
|
|
|
template<typename A, typename B, B> struct Tmpl_T_T_B {};
|
|
|
|
|
2013-10-16 06:02:41 +08:00
|
|
|
template<int> struct UseInt {};
|
|
|
|
|
2013-06-24 12:45:28 +08:00
|
|
|
void g() {
|
|
|
|
f(0);
|
|
|
|
f<double>(1.0);
|
|
|
|
f<int>();
|
|
|
|
f(); // expected-error {{no matching function}}
|
2015-09-02 04:35:42 +08:00
|
|
|
// expected-note@Inputs/cxx-templates-a.h:3 {{couldn't infer template argument}}
|
|
|
|
// expected-note@Inputs/cxx-templates-a.h:4 {{requires 1 argument}}
|
2013-06-24 12:45:28 +08:00
|
|
|
|
|
|
|
N::f(0);
|
|
|
|
N::f<double>(1.0);
|
|
|
|
N::f<int>();
|
|
|
|
N::f(); // expected-error {{no matching function}}
|
2014-08-13 09:23:33 +08:00
|
|
|
// expected-note@Inputs/cxx-templates-b.h:6 {{couldn't infer template argument}}
|
2015-09-01 09:37:34 +08:00
|
|
|
// expected-note@Inputs/cxx-templates-b.h:7 {{requires single argument}}
|
2013-06-25 06:51:00 +08:00
|
|
|
|
|
|
|
template_param_kinds_1<0>(); // ok, from cxx-templates-a.h
|
|
|
|
template_param_kinds_1<int>(); // ok, from cxx-templates-b.h
|
|
|
|
|
|
|
|
template_param_kinds_2<Tmpl_T_C>(); // expected-error {{no matching function}}
|
2013-06-25 09:25:15 +08:00
|
|
|
// expected-note@Inputs/cxx-templates-a.h:11 {{invalid explicitly-specified argument}}
|
|
|
|
// expected-note@Inputs/cxx-templates-b.h:11 {{invalid explicitly-specified argument}}
|
2013-06-25 06:51:00 +08:00
|
|
|
|
|
|
|
template_param_kinds_2<Tmpl_T_I_I>(); // expected-error {{ambiguous}}
|
2013-06-25 09:25:15 +08:00
|
|
|
// expected-note@Inputs/cxx-templates-a.h:11 {{candidate}}
|
|
|
|
// expected-note@Inputs/cxx-templates-b.h:11 {{candidate}}
|
2013-06-25 06:51:00 +08:00
|
|
|
|
2017-04-14 05:37:24 +08:00
|
|
|
// FIXME: This should be valid, but we incorrectly match the template template
|
|
|
|
// argument against both template template parameters.
|
|
|
|
template_param_kinds_3<Tmpl_T_T_A>(); // expected-error {{ambiguous}}
|
|
|
|
// expected-note@Inputs/cxx-templates-a.h:12 {{candidate}}
|
|
|
|
// expected-note@Inputs/cxx-templates-b.h:12 {{candidate}}
|
|
|
|
template_param_kinds_3<Tmpl_T_T_B>(); // expected-error {{ambiguous}}
|
|
|
|
// expected-note@Inputs/cxx-templates-a.h:12 {{candidate}}
|
|
|
|
// expected-note@Inputs/cxx-templates-b.h:12 {{candidate}}
|
When we perform dependent name lookup during template instantiation, it's not
sufficient to only consider names visible at the point of instantiation,
because that may not include names that were visible when the template was
defined. More generally, if the instantiation backtrace goes through a module
M, then every declaration visible within M should be available to the
instantiation. Any of those declarations might be part of the interface that M
intended to export to a template that it instantiates.
The fix here has two parts:
1) If we find a non-visible declaration during name lookup during template
instantiation, check whether the declaration was visible from the defining
module of all entities on the active template instantiation stack. The defining
module is not the owning module in all cases: we look at the module in which a
template was defined, not the module in which it was first instantiated.
2) Perform pending instantiations at the end of a module, not at the end of the
translation unit. This is general goodness, since it significantly cuts down
the amount of redundant work that is performed in every TU importing a module,
and also implicitly adds the module containing the point of instantiation to
the set of modules checked for declarations in a lookup within a template
instantiation.
There's a known issue here with template instantiations performed while
building a module, if additional imports are added later on. I'll fix that
in a subsequent commit.
llvm-svn: 187167
2013-07-26 07:08:39 +08:00
|
|
|
|
|
|
|
// Trigger the instantiation of a template in 'a' that uses a type defined in
|
|
|
|
// 'common'. That type is not visible here.
|
|
|
|
PerformDelayedLookup(defined_in_common);
|
|
|
|
|
2013-08-01 12:12:04 +08:00
|
|
|
// Likewise, but via a default argument.
|
|
|
|
PerformDelayedLookupInDefaultArgument(defined_in_common);
|
|
|
|
|
When we perform dependent name lookup during template instantiation, it's not
sufficient to only consider names visible at the point of instantiation,
because that may not include names that were visible when the template was
defined. More generally, if the instantiation backtrace goes through a module
M, then every declaration visible within M should be available to the
instantiation. Any of those declarations might be part of the interface that M
intended to export to a template that it instantiates.
The fix here has two parts:
1) If we find a non-visible declaration during name lookup during template
instantiation, check whether the declaration was visible from the defining
module of all entities on the active template instantiation stack. The defining
module is not the owning module in all cases: we look at the module in which a
template was defined, not the module in which it was first instantiated.
2) Perform pending instantiations at the end of a module, not at the end of the
translation unit. This is general goodness, since it significantly cuts down
the amount of redundant work that is performed in every TU importing a module,
and also implicitly adds the module containing the point of instantiation to
the set of modules checked for declarations in a lookup within a template
instantiation.
There's a known issue here with template instantiations performed while
building a module, if additional imports are added later on. I'll fix that
in a subsequent commit.
llvm-svn: 187167
2013-07-26 07:08:39 +08:00
|
|
|
// Trigger the instantiation of a template in 'b' that uses a type defined in
|
|
|
|
// 'b_impl'. That type is not visible here.
|
|
|
|
UseDefinedInBImpl<int>();
|
|
|
|
|
|
|
|
// Trigger the instantiation of a template in 'a' that uses a type defined in
|
|
|
|
// 'b_impl', via a template defined in 'b'. Since the type is visible from
|
|
|
|
// within 'b', the instantiation succeeds.
|
|
|
|
UseDefinedInBImplIndirectly(defined_in_b_impl);
|
|
|
|
|
|
|
|
// Trigger the instantiation of a template in 'a' that uses a type defined in
|
|
|
|
// 'b_impl'. That type is not visible here, nor in 'a'. This fails; there is
|
|
|
|
// no reason why DefinedInBImpl should be visible here.
|
2014-05-07 10:25:43 +08:00
|
|
|
//
|
|
|
|
// We turn off error recovery for modules in this test (so we don't get an
|
|
|
|
// implicit import of cxx_templates_b_impl), and that results in us producing
|
|
|
|
// a big spew of errors here.
|
|
|
|
//
|
When we perform dependent name lookup during template instantiation, it's not
sufficient to only consider names visible at the point of instantiation,
because that may not include names that were visible when the template was
defined. More generally, if the instantiation backtrace goes through a module
M, then every declaration visible within M should be available to the
instantiation. Any of those declarations might be part of the interface that M
intended to export to a template that it instantiates.
The fix here has two parts:
1) If we find a non-visible declaration during name lookup during template
instantiation, check whether the declaration was visible from the defining
module of all entities on the active template instantiation stack. The defining
module is not the owning module in all cases: we look at the module in which a
template was defined, not the module in which it was first instantiated.
2) Perform pending instantiations at the end of a module, not at the end of the
translation unit. This is general goodness, since it significantly cuts down
the amount of redundant work that is performed in every TU importing a module,
and also implicitly adds the module containing the point of instantiation to
the set of modules checked for declarations in a lookup within a template
instantiation.
There's a known issue here with template instantiations performed while
building a module, if additional imports are added later on. I'll fix that
in a subsequent commit.
llvm-svn: 187167
2013-07-26 07:08:39 +08:00
|
|
|
// expected-error@Inputs/cxx-templates-a.h:19 {{definition of 'DefinedInBImpl' must be imported}}
|
2014-05-07 10:25:43 +08:00
|
|
|
// expected-note@Inputs/cxx-templates-b-impl.h:1 +{{definition is here}}
|
|
|
|
// expected-error@Inputs/cxx-templates-a.h:19 +{{}}
|
|
|
|
// expected-error@Inputs/cxx-templates-a.h:20 +{{}}
|
When we perform dependent name lookup during template instantiation, it's not
sufficient to only consider names visible at the point of instantiation,
because that may not include names that were visible when the template was
defined. More generally, if the instantiation backtrace goes through a module
M, then every declaration visible within M should be available to the
instantiation. Any of those declarations might be part of the interface that M
intended to export to a template that it instantiates.
The fix here has two parts:
1) If we find a non-visible declaration during name lookup during template
instantiation, check whether the declaration was visible from the defining
module of all entities on the active template instantiation stack. The defining
module is not the owning module in all cases: we look at the module in which a
template was defined, not the module in which it was first instantiated.
2) Perform pending instantiations at the end of a module, not at the end of the
translation unit. This is general goodness, since it significantly cuts down
the amount of redundant work that is performed in every TU importing a module,
and also implicitly adds the module containing the point of instantiation to
the set of modules checked for declarations in a lookup within a template
instantiation.
There's a known issue here with template instantiations performed while
building a module, if additional imports are added later on. I'll fix that
in a subsequent commit.
llvm-svn: 187167
2013-07-26 07:08:39 +08:00
|
|
|
PerformDelayedLookup(defined_in_b_impl); // expected-note {{in instantiation of}}
|
2013-10-14 07:50:45 +08:00
|
|
|
|
|
|
|
merge_templates_a = merge_templates_b; // ok, same type
|
2013-10-16 06:02:41 +08:00
|
|
|
|
|
|
|
using T = decltype(enum_a_from_a);
|
|
|
|
using T = decltype(enum_b_from_b);
|
|
|
|
T e = true ? enum_a_from_a : enum_b_from_b;
|
|
|
|
|
|
|
|
UseRedeclaredEnum<int>(UseInt<1>());
|
|
|
|
// FIXME: Reintroduce this once we merge function template specializations.
|
|
|
|
//static_assert(UseRedeclaredEnumA == UseRedeclaredEnumB, "");
|
|
|
|
//static_assert(UseRedeclaredEnumA == UseRedeclaredEnum<int>, "");
|
|
|
|
//static_assert(UseRedeclaredEnumB == UseRedeclaredEnum<int>, "");
|
|
|
|
static_assert(enum_c_from_a == enum_c_from_b, "");
|
|
|
|
CommonTemplate<int> cti;
|
|
|
|
CommonTemplate<int>::E eee = CommonTemplate<int>::c;
|
2014-05-07 10:25:43 +08:00
|
|
|
|
|
|
|
TemplateInstantiationVisibility<char[1]> tiv1;
|
|
|
|
TemplateInstantiationVisibility<char[2]> tiv2;
|
2016-05-05 08:56:12 +08:00
|
|
|
TemplateInstantiationVisibility<char[3]> tiv3; // expected-error 5{{must be imported from module 'cxx_templates_b_impl'}}
|
|
|
|
// expected-note@cxx-templates-b-impl.h:10 3{{explicit specialization declared here}}
|
2015-12-19 06:19:11 +08:00
|
|
|
// expected-note@cxx-templates-b-impl.h:10 2{{previous definition is here}}
|
2014-05-07 10:25:43 +08:00
|
|
|
TemplateInstantiationVisibility<char[4]> tiv4;
|
2014-05-23 04:59:29 +08:00
|
|
|
|
|
|
|
int &p = WithPartialSpecializationUse().f();
|
2014-05-24 05:00:28 +08:00
|
|
|
int &q = WithExplicitSpecializationUse().inner_template<int>();
|
2014-07-29 08:58:01 +08:00
|
|
|
int *r = PartiallyInstantiatePartialSpec<int*>::bar();
|
2014-08-14 10:21:01 +08:00
|
|
|
|
|
|
|
(void)&WithImplicitSpecialMembers<int>::n;
|
2014-08-23 08:49:01 +08:00
|
|
|
|
|
|
|
MergeClassTemplateSpecializations_string s;
|
2014-10-22 05:15:18 +08:00
|
|
|
|
|
|
|
extern TestInjectedClassName::A *use_a;
|
|
|
|
extern TestInjectedClassName::C *use_c;
|
|
|
|
TestInjectedClassName::UseD();
|
2013-06-24 12:45:28 +08:00
|
|
|
}
|
|
|
|
|
2014-07-11 08:20:06 +08:00
|
|
|
static_assert(Outer<int>::Inner<int>::f() == 1, "");
|
|
|
|
static_assert(Outer<int>::Inner<int>::g() == 2, "");
|
|
|
|
|
2015-03-28 05:16:39 +08:00
|
|
|
static_assert(MergeTemplateDefinitions<int>::f() == 1, "");
|
2014-07-12 02:22:58 +08:00
|
|
|
static_assert(MergeTemplateDefinitions<int>::g() == 2, "");
|
|
|
|
|
2013-08-02 09:09:12 +08:00
|
|
|
RedeclaredAsFriend<int> raf1;
|
|
|
|
RedeclareTemplateAsFriend<double> rtaf;
|
|
|
|
RedeclaredAsFriend<double> raf2;
|
|
|
|
|
2013-10-16 07:19:58 +08:00
|
|
|
MergeSpecializations<int*>::partially_specialized_in_a spec_in_a_1;
|
|
|
|
MergeSpecializations<int&>::partially_specialized_in_b spec_in_b_1;
|
|
|
|
MergeSpecializations<int[]>::partially_specialized_in_c spec_in_c_1;
|
|
|
|
MergeSpecializations<char>::explicitly_specialized_in_a spec_in_a_2;
|
|
|
|
MergeSpecializations<double>::explicitly_specialized_in_b spec_in_b_2;
|
|
|
|
MergeSpecializations<bool>::explicitly_specialized_in_c spec_in_c_2;
|
|
|
|
|
2014-10-11 06:37:41 +08:00
|
|
|
MergeAnonUnionMember<> maum_main;
|
2014-10-11 08:37:16 +08:00
|
|
|
typedef DontWalkPreviousDeclAfterMerging<int> dwpdam_typedef_2;
|
|
|
|
dwpdam_typedef::type dwpdam_typedef_use;
|
|
|
|
DontWalkPreviousDeclAfterMerging<int>::Inner::type dwpdam;
|
2014-10-11 06:37:41 +08:00
|
|
|
|
2014-08-26 11:52:16 +08:00
|
|
|
using AliasTemplateMergingTest = WithAliasTemplate<int>::X<char>;
|
|
|
|
|
2014-08-28 13:44:07 +08:00
|
|
|
int AnonymousDeclsMergingTest(WithAnonymousDecls<int> WAD, WithAnonymousDecls<char> WADC) {
|
2014-08-28 09:33:39 +08:00
|
|
|
return InstantiateWithAnonymousDeclsA(WAD) +
|
2014-08-28 13:44:07 +08:00
|
|
|
InstantiateWithAnonymousDeclsB(WAD) +
|
|
|
|
InstantiateWithAnonymousDeclsB2(WADC) +
|
|
|
|
InstantiateWithAnonymousDeclsD(WADC);
|
2014-08-28 09:33:39 +08:00
|
|
|
}
|
|
|
|
|
2013-06-25 09:25:15 +08:00
|
|
|
@import cxx_templates_common;
|
|
|
|
|
|
|
|
typedef SomeTemplate<int*> SomeTemplateIntPtr;
|
|
|
|
typedef SomeTemplate<int&> SomeTemplateIntRef;
|
|
|
|
SomeTemplate<char*> some_template_char_ptr;
|
|
|
|
SomeTemplate<char&> some_template_char_ref;
|
|
|
|
|
2013-09-10 00:55:27 +08:00
|
|
|
void testImplicitSpecialMembers(SomeTemplate<char[1]> &a,
|
|
|
|
const SomeTemplate<char[1]> &b,
|
|
|
|
SomeTemplate<char[2]> &c,
|
|
|
|
const SomeTemplate<char[2]> &d) {
|
|
|
|
a = b;
|
|
|
|
c = d;
|
|
|
|
}
|
|
|
|
|
2014-03-23 10:30:01 +08:00
|
|
|
bool testFriendInClassTemplate(Std::WithFriend<int> wfi) {
|
|
|
|
return wfi != wfi;
|
|
|
|
}
|
|
|
|
|
2016-05-05 08:56:12 +08:00
|
|
|
namespace hidden_specializations {
|
|
|
|
// expected-note@cxx-templates-unimported.h:* 1+{{here}}
|
|
|
|
void test() {
|
|
|
|
// For functions, uses that would trigger instantiations of definitions are
|
|
|
|
// not allowed.
|
|
|
|
fn<void>(); // ok
|
|
|
|
fn<char>(); // ok
|
|
|
|
fn<int>(); // expected-error 1+{{explicit specialization of 'fn<int>' must be imported}}
|
|
|
|
cls<void>::nested_fn(); // expected-error 1+{{explicit specialization of 'nested_fn' must be imported}}
|
|
|
|
cls<void>::nested_fn_t<int>(); // expected-error 1+{{explicit specialization of 'nested_fn_t' must be imported}}
|
|
|
|
cls<void>::nested_fn_t<char>(); // expected-error 1+{{explicit specialization of 'nested_fn_t' must be imported}}
|
|
|
|
|
|
|
|
// For classes, uses that would trigger instantiations of definitions are
|
|
|
|
// not allowed.
|
|
|
|
cls<void> *k0; // ok
|
|
|
|
cls<char> *k1; // ok
|
|
|
|
cls<int> *k2; // ok
|
|
|
|
cls<int*> *k3; // ok
|
|
|
|
cls<void>::nested_cls *nk1; // ok
|
|
|
|
cls<void>::nested_cls_t<int> *nk2; // ok
|
|
|
|
cls<void>::nested_cls_t<char> *nk3; // ok
|
|
|
|
cls<int> uk1; // expected-error 1+{{explicit specialization of 'cls<int>' must be imported}} expected-error 1+{{definition of}}
|
2016-12-24 12:09:05 +08:00
|
|
|
cls<int*> uk3; // expected-error 1+{{partial specialization of 'cls<T *>' must be imported}} expected-error 1+{{definition of}}
|
|
|
|
cls<char*> uk4; // expected-error 1+{{partial specialization of 'cls<T *>' must be imported}} expected-error 1+{{definition of}}
|
2016-05-05 08:56:12 +08:00
|
|
|
cls<void>::nested_cls unk1; // expected-error 1+{{explicit specialization of 'nested_cls' must be imported}} expected-error 1+{{definition of}}
|
|
|
|
cls<void>::nested_cls_t<int> unk2; // expected-error 1+{{explicit specialization of 'nested_cls_t' must be imported}} expected-error 1+{{definition of}}
|
|
|
|
cls<void>::nested_cls_t<char> unk3; // expected-error 1+{{explicit specialization of 'nested_cls_t' must be imported}}
|
|
|
|
|
|
|
|
// For enums, uses that would trigger instantiations of definitions are not
|
|
|
|
// allowed.
|
|
|
|
cls<void>::nested_enum e; // ok
|
|
|
|
(void)cls<void>::nested_enum::e; // expected-error 1+{{definition of 'nested_enum' must be imported}} expected-error 1+{{declaration of 'e'}}
|
|
|
|
|
|
|
|
// For variable template specializations, no uses are allowed because
|
|
|
|
// specializations can change the type.
|
|
|
|
(void)sizeof(var<void>); // ok
|
|
|
|
(void)sizeof(var<char>); // ok
|
|
|
|
(void)sizeof(var<int>); // expected-error 1+{{explicit specialization of 'var<int>' must be imported}}
|
2016-12-24 12:09:05 +08:00
|
|
|
(void)sizeof(var<int*>); // expected-error 1+{{partial specialization of 'var<T *>' must be imported}}
|
|
|
|
(void)sizeof(var<char*>); // expected-error 1+{{partial specialization of 'var<T *>' must be imported}}
|
2016-05-05 08:56:12 +08:00
|
|
|
(void)sizeof(cls<void>::nested_var); // ok
|
|
|
|
(void)cls<void>::nested_var; // expected-error 1+{{explicit specialization of 'nested_var' must be imported}}
|
|
|
|
(void)sizeof(cls<void>::nested_var_t<int>); // expected-error 1+{{explicit specialization of 'nested_var_t' must be imported}}
|
|
|
|
(void)sizeof(cls<void>::nested_var_t<char>); // expected-error 1+{{explicit specialization of 'nested_var_t' must be imported}}
|
|
|
|
}
|
|
|
|
|
|
|
|
void cls<int>::nested_fn() {} // expected-error 1+{{explicit specialization of 'cls<int>' must be imported}} expected-error 1+{{definition of}}
|
|
|
|
struct cls<int>::nested_cls {}; // expected-error 1+{{explicit specialization of 'cls<int>' must be imported}} expected-error 1+{{definition of}}
|
|
|
|
int cls<int>::nested_var; // expected-error 1+{{explicit specialization of 'cls<int>' must be imported}} expected-error 1+{{definition of}}
|
|
|
|
enum cls<int>::nested_enum : int {}; // expected-error 1+{{explicit specialization of 'cls<int>' must be imported}} expected-error 1+{{definition of}}
|
|
|
|
|
2016-12-24 12:09:05 +08:00
|
|
|
template<typename T> void cls<T*>::nested_fn() {} // expected-error 1+{{partial specialization of 'cls<T *>' must be imported}}
|
|
|
|
template<typename T> struct cls<T*>::nested_cls {}; // expected-error 1+{{partial specialization of 'cls<T *>' must be imported}}
|
|
|
|
template<typename T> int cls<T*>::nested_var; // expected-error 1+{{partial specialization of 'cls<T *>' must be imported}}
|
|
|
|
template<typename T> enum cls<T*>::nested_enum : int {}; // expected-error 1+{{partial specialization of 'cls<T *>' must be imported}}
|
2016-05-05 08:56:12 +08:00
|
|
|
}
|
|
|
|
|
2014-03-24 03:45:26 +08:00
|
|
|
namespace Std {
|
|
|
|
void g(); // expected-error {{functions that differ only in their return type cannot be overloaded}}
|
|
|
|
// expected-note@cxx-templates-common.h:21 {{previous}}
|
|
|
|
}
|
|
|
|
|
2013-06-24 12:45:28 +08:00
|
|
|
// CHECK-GLOBAL: DeclarationName 'f'
|
|
|
|
// CHECK-GLOBAL-NEXT: |-FunctionTemplate {{.*}} 'f'
|
2015-09-02 04:35:42 +08:00
|
|
|
// CHECK-GLOBAL-NEXT: |-FunctionTemplate {{.*}} 'f'
|
|
|
|
// CHECK-GLOBAL-NEXT: |-FunctionTemplate {{.*}} 'f'
|
2013-06-24 12:45:28 +08:00
|
|
|
// CHECK-GLOBAL-NEXT: `-FunctionTemplate {{.*}} 'f'
|
|
|
|
|
|
|
|
// CHECK-NAMESPACE-N: DeclarationName 'f'
|
|
|
|
// CHECK-NAMESPACE-N-NEXT: |-FunctionTemplate {{.*}} 'f'
|
2015-09-02 04:35:42 +08:00
|
|
|
// CHECK-NAMESPACE-N-NEXT: |-FunctionTemplate {{.*}} 'f'
|
|
|
|
// CHECK-NAMESPACE-N-NEXT: |-FunctionTemplate {{.*}} 'f'
|
2013-06-24 12:45:28 +08:00
|
|
|
// CHECK-NAMESPACE-N-NEXT: `-FunctionTemplate {{.*}} 'f'
|
2014-03-18 10:07:28 +08:00
|
|
|
|
2014-04-02 13:48:29 +08:00
|
|
|
// CHECK-DUMP: ClassTemplateDecl {{.*}} <{{.*[/\\]}}cxx-templates-common.h:1:1, {{.*}}> col:{{.*}} in cxx_templates_common SomeTemplate
|
2015-02-13 07:21:45 +08:00
|
|
|
// CHECK-DUMP: ClassTemplateSpecializationDecl {{.*}} prev {{.*}} SomeTemplate
|
2015-08-22 09:47:18 +08:00
|
|
|
// CHECK-DUMP-NEXT: TemplateArgument type 'char [2]'
|
|
|
|
// CHECK-DUMP: ClassTemplateSpecializationDecl {{.*}} SomeTemplate definition
|
2017-09-22 08:11:15 +08:00
|
|
|
// CHECK-DUMP-NEXT: DefinitionData
|
|
|
|
// CHECK-DUMP-NEXT: DefaultConstructor
|
|
|
|
// CHECK-DUMP-NEXT: CopyConstructor
|
|
|
|
// CHECK-DUMP-NEXT: MoveConstructor
|
|
|
|
// CHECK-DUMP-NEXT: CopyAssignment
|
|
|
|
// CHECK-DUMP-NEXT: MoveAssignment
|
|
|
|
// CHECK-DUMP-NEXT: Destructor
|
2015-08-22 09:47:18 +08:00
|
|
|
// CHECK-DUMP-NEXT: TemplateArgument type 'char [2]'
|
2016-10-07 04:30:51 +08:00
|
|
|
// CHECK-DUMP: ClassTemplateSpecializationDecl {{.*}} prev {{.*}} SomeTemplate
|
|
|
|
// CHECK-DUMP-NEXT: TemplateArgument type 'char [1]'
|
|
|
|
// CHECK-DUMP: ClassTemplateSpecializationDecl {{.*}} SomeTemplate definition
|
2017-09-22 08:11:15 +08:00
|
|
|
// CHECK-DUMP-NEXT: DefinitionData
|
|
|
|
// CHECK-DUMP-NEXT: DefaultConstructor
|
|
|
|
// CHECK-DUMP-NEXT: CopyConstructor
|
|
|
|
// CHECK-DUMP-NEXT: MoveConstructor
|
|
|
|
// CHECK-DUMP-NEXT: CopyAssignment
|
|
|
|
// CHECK-DUMP-NEXT: MoveAssignment
|
|
|
|
// CHECK-DUMP-NEXT: Destructor
|
2016-10-07 04:30:51 +08:00
|
|
|
// CHECK-DUMP-NEXT: TemplateArgument type 'char [1]'
|