Skip to content

Commit 15c2a56

Browse files
committed
std
1 parent f5153ac commit 15c2a56

File tree

8 files changed

+91
-6
lines changed

8 files changed

+91
-6
lines changed

test-files/golden-tests/config/sfinae/redeclare.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
// issue #850
22

3-
#include <type_traits>
3+
namespace std
4+
{
5+
template <bool C, typename T = void>
6+
struct enable_if
7+
{
8+
using type = T;
9+
};
10+
11+
template <bool C, typename T = void>
12+
using enable_if_t = typename enable_if<C, T>::type;
13+
14+
template <typename T>
15+
struct is_class
16+
{
17+
static constexpr bool value = true;
18+
};
19+
20+
template <typename T>
21+
bool is_class_v = is_class<T>::value;
22+
}
423

524
template <typename T>
625
void f(std::enable_if_t<std::is_class_v<T>>);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
exclude-symbols:
2+
- 'std::**'
Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
// issue #849
22

3-
#include <type_traits>
3+
namespace std
4+
{
5+
template <bool C, typename T = void>
6+
struct enable_if
7+
{
8+
using type = T;
9+
};
10+
11+
template <bool C, typename T = void>
12+
using enable_if_t = typename enable_if<C, T>::type;
13+
14+
template <typename T>
15+
struct is_class
16+
{
17+
static constexpr bool value = true;
18+
};
19+
20+
template <typename T>
21+
bool is_class_v = is_class<T>::value;
22+
}
423

524
template <typename T>
625
std::enable_if_t<std::is_class_v<T>, int> f();
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
exclude-symbols:
2+
- 'std::**'

test-files/golden-tests/snippets/sqrt.cpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1-
#include <type_traits>
2-
#include <stdexcept>
1+
namespace std
2+
{
3+
template <bool C, typename T = void>
4+
struct enable_if
5+
{
6+
using type = T;
7+
};
8+
9+
template <bool C, typename T = void>
10+
using enable_if_t = typename enable_if<C, T>::type;
11+
12+
template <typename T>
13+
struct is_integral
14+
{
15+
static constexpr bool value = true;
16+
};
17+
18+
template <typename T>
19+
bool is_integral_v = is_integral<T>::value;
20+
}
321

422
/** Computes the square root of an integral value.
523
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
exclude-symbols:
2+
- 'std::**'

test-files/golden-tests/symbols/function/sfinae.cpp

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
1-
#include <type_traits>
2-
#include <stdexcept>
1+
namespace std
2+
{
3+
template <bool C, typename T = void>
4+
struct enable_if
5+
{
6+
using type = T;
7+
};
8+
9+
template <bool C, typename T = void>
10+
using enable_if_t = typename enable_if<C, T>::type;
11+
12+
template <typename ...Ts>
13+
using void_t = void;
14+
15+
template <typename T>
16+
struct is_integral
17+
{
18+
static constexpr bool value = true;
19+
};
20+
21+
template <typename T>
22+
bool is_integral_v = is_integral<T>::value;
23+
}
324

425
/// Enabled via return type
526
template <class T>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
warn-if-doc-error: false
22
warn-no-paramdoc: false
3+
exclude-symbols:
4+
- 'std::**'

0 commit comments

Comments
 (0)