diff options
Diffstat (limited to 'test/SemaCXX/enable_if.cpp')
-rw-r--r-- | test/SemaCXX/enable_if.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaCXX/enable_if.cpp b/test/SemaCXX/enable_if.cpp index 9a06d3866110..93014f50d508 100644 --- a/test/SemaCXX/enable_if.cpp +++ b/test/SemaCXX/enable_if.cpp @@ -499,3 +499,17 @@ void run() { } } } + +namespace TypeOfFn { + template <typename T, typename U> + struct is_same; + + template <typename T> struct is_same<T, T> { + enum { value = 1 }; + }; + + void foo(int a) __attribute__((enable_if(a, ""))); + void foo(float a) __attribute__((enable_if(1, ""))); + + static_assert(is_same<__typeof__(foo)*, decltype(&foo)>::value, ""); +} |