blob: 9bc76d5bbaea48e79991c41f09f883464065859d [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
20@import cxx_templates_b_impl;
21
22template<typename T, typename> struct Identity { typedef T type; };
23template<typename T> void UseDefinedInBImpl() {
24 typename Identity<DefinedInBImpl, T>::type dependent;
25 FoundByADL(dependent);
26 typename Identity<DefinedInBImpl, T>::type::Inner inner;
27 dependent.f();
28}
29
30extern DefinedInBImpl &defined_in_b_impl;
31
Richard Smith7ecc31b2013-08-02 01:09:12 +000032template<typename T>
33struct RedeclareTemplateAsFriend {
34 template<typename U>
35 friend struct RedeclaredAsFriend;
36};
37
Richard Smith0e5d7b82013-07-25 23:08:39 +000038@import cxx_templates_a;
39template<typename T> void UseDefinedInBImplIndirectly(T &v) {
40 PerformDelayedLookup(v);
41}
42
43void TriggerInstantiation() {
44 UseDefinedInBImpl<void>();
45}