@@ -297,43 +297,16 @@ inline bool doesKeywordAttributeTakeArgs(tok::TokenKind Kind) {
297
297
}
298
298
}
299
299
300
- inline const StreamingDiagnostic &operator <<(const StreamingDiagnostic &DB,
301
- const AttributeCommonInfo &CI) {
302
- DB.AddTaggedVal (reinterpret_cast <uint64_t >(&CI),
303
- DiagnosticsEngine::ak_attr_info);
304
- return DB;
305
- }
306
-
307
300
inline const StreamingDiagnostic &operator <<(const StreamingDiagnostic &DB,
308
301
const AttributeCommonInfo *CI) {
309
302
DB.AddTaggedVal (reinterpret_cast <uint64_t >(CI),
310
303
DiagnosticsEngine::ak_attr_info);
311
304
return DB;
312
305
}
313
306
314
- // / AttributeCommonInfo has a non-explicit constructor which takes an
315
- // / SourceRange as its only argument, this constructor has many uses so making
316
- // / it explicit is hard. This constructor causes ambiguity with
317
- // / DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, SourceRange R).
318
- // / We use SFINAE to disable any conversion and remove any ambiguity.
319
- template <
320
- typename ACI,
321
- std::enable_if_t <std::is_same<ACI, AttributeCommonInfo>::value, int > = 0 >
322
307
inline const StreamingDiagnostic &operator <<(const StreamingDiagnostic &DB,
323
- const ACI &CI) {
324
- DB.AddTaggedVal (reinterpret_cast <uint64_t >(&CI),
325
- DiagnosticsEngine::ak_attr_info);
326
- return DB;
327
- }
328
-
329
- template <
330
- typename ACI,
331
- std::enable_if_t <std::is_same<ACI, AttributeCommonInfo>::value, int > = 0 >
332
- inline const StreamingDiagnostic &operator <<(const StreamingDiagnostic &DB,
333
- const ACI *CI) {
334
- DB.AddTaggedVal (reinterpret_cast <uint64_t >(CI),
335
- DiagnosticsEngine::ak_attr_info);
336
- return DB;
308
+ const AttributeCommonInfo &CI) {
309
+ return DB << &CI;
337
310
}
338
311
339
312
} // namespace clang
0 commit comments