File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,25 @@ namespace std {
14
14
static constexpr bool value = true ;
15
15
};
16
16
17
+ template <typename T, typename U>
18
+ static constexpr bool is_same_v = is_same<T, U>::value; // NOLINT
19
+
17
20
template <bool , typename T = void >
18
21
struct enable_if {
19
22
using type = T;
20
23
};
21
24
25
+ template <bool B, typename T = void >
26
+ using enable_if_t = typename enable_if<B, T>::type; // NOLINT
27
+
28
+ template <typename T>
29
+ struct remove_reference {
30
+ using type = T;
31
+ };
32
+
33
+ template <typename T>
34
+ using remove_reference_t = typename remove_reference<T>::type; // NOLINT
35
+
22
36
template <typename ...>
23
37
struct common_type {
24
38
using type = int ;
@@ -126,3 +140,13 @@ namespace my_std = std;
126
140
using Alias = my_std::add_const<bool >::type;
127
141
// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: use c++14 style type templates
128
142
// CHECK-FIXES: using Alias = my_std::add_const_t<bool>;
143
+
144
+ template <typename T>
145
+ struct ImplicitlyInstantiatedConstructor {
146
+ template <typename U, typename = std::enable_if_t <std::is_same_v<U, T>>>
147
+ ImplicitlyInstantiatedConstructor (U) {}
148
+ };
149
+
150
+ const ImplicitlyInstantiatedConstructor<int > ImplicitInstantiation (std::remove_reference<int >::type(123 ));
151
+ // CHECK-MESSAGES: :[[@LINE-1]]:68: warning: use c++14 style type templates
152
+ // CHECK-FIXES: const ImplicitlyInstantiatedConstructor<int> ImplicitInstantiation(std::remove_reference_t<int>(123));
Original file line number Diff line number Diff line change @@ -2194,6 +2194,7 @@ bool RecursiveASTVisitor<Derived>::TraverseTemplateArgumentLocsHelper(
2194
2194
is the only callback that's made for this instantiation. \
2195
2195
We use getTemplateArgsAsWritten() to distinguish. */ \
2196
2196
if (const auto *ArgsWritten = D->getTemplateArgsAsWritten ()) { \
2197
+ assert (D->getTemplateSpecializationKind () != TSK_ImplicitInstantiation); \
2197
2198
/* The args that remains unspecialized. */ \
2198
2199
TRY_TO (TraverseTemplateArgumentLocsHelper ( \
2199
2200
ArgsWritten->getTemplateArgs (), ArgsWritten->NumTemplateArgs )); \
You can’t perform that action at this time.
0 commit comments