blob: 6cc951b0ee35ff1c72055a37cf0f28bdde3dda66 [file] [log] [blame]
Richard Smith5de91b52013-06-25 01:25:15 +00001@import cxx_templates_common;
2
Richard Smith8f8f05c2013-06-24 04:45:28 +00003template<typename T> T f();
4template<typename T> T f(T t) { return t; }
5namespace N {
6 template<typename T> T f();
7 template<typename T> T f(T t) { return t; }
8}
Richard Smithbf78e642013-06-24 22:51:00 +00009
10template<typename> int template_param_kinds_1();
11template<template<typename, int, int...> class> int template_param_kinds_2();
12template<template<typename T, typename U, U> class> int template_param_kinds_3();
Richard Smith5de91b52013-06-25 01:25:15 +000013
14template<typename T> struct SomeTemplate<T&> {};
15template<typename T> struct SomeTemplate<T&>;
16typedef SomeTemplate<int&> SomeTemplateIntRef;
Richard Smith0e5d7b82013-07-25 23:08:39 +000017
18extern DefinedInCommon &defined_in_common;
19
Richard Smithd46d6de2013-10-13 23:50:45 +000020template<int> struct MergeTemplates;
21MergeTemplates<0> *merge_templates_b;
22
Richard Smith0e5d7b82013-07-25 23:08:39 +000023@import cxx_templates_b_impl;
24
25template<typename T, typename> struct Identity { typedef T type; };
26template<typename T> void UseDefinedInBImpl() {
27 typename Identity<DefinedInBImpl, T>::type dependent;
28 FoundByADL(dependent);
29 typename Identity<DefinedInBImpl, T>::type::Inner inner;
30 dependent.f();
31}
32
33extern DefinedInBImpl &defined_in_b_impl;
34
Richard Smith7ecc31b2013-08-02 01:09:12 +000035template<typename T>
36struct RedeclareTemplateAsFriend {
37 template<typename U>
38 friend struct RedeclaredAsFriend;
39};
40
Richard Smithd55889a2013-09-09 16:55:27 +000041void use_some_template_b() {
42 SomeTemplate<char[1]> a;
43 SomeTemplate<char[2]> b, c;
44 b = c;
45}
46
Richard Smith0e5d7b82013-07-25 23:08:39 +000047@import cxx_templates_a;
48template<typename T> void UseDefinedInBImplIndirectly(T &v) {
49 PerformDelayedLookup(v);
50}
51
52void TriggerInstantiation() {
53 UseDefinedInBImpl<void>();
54}