| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 |
|
| 3 |
#ifdef BE_THE_HEADER |
| 4 |
#pragma clang system_header |
| 5 |
|
| 6 |
template <typename T> |
| 7 |
struct traits; |
| 8 |
|
| 9 |
template <> |
| 10 |
struct [[deprecated]] traits<int> {}; // expected-note {{'traits<int>' has been explicitly marked deprecated here}} |
| 11 |
|
| 12 |
template<typename T, typename Trait = traits<T>> // expected-warning {{'traits<int>' is deprecated}} |
| 13 |
struct basic_string {}; |
| 14 |
|
| 15 |
// should not warn, defined and used in system headers |
| 16 |
using __do_what_i_say_not_what_i_do = traits<int> ; |
| 17 |
|
| 18 |
template<typename T, typename Trait = traits<double>> |
| 19 |
struct should_not_warn {}; |
| 20 |
|
| 21 |
#else |
| 22 |
#define BE_THE_HEADER |
| 23 |
#include __FILE__ |
| 24 |
|
| 25 |
basic_string<int> test1; // expected-note {{in instantiation of default argument for 'basic_string<int>' required here}} |
| 26 |
should_not_warn<int> test2; |
| 27 |
|
| 28 |
#endif |