blob: bcd2385fdd14c7d489d0dfa6b97d35a122bb8325 [file] [log] [blame]
Michael Liaoce389922019-03-29 03:55:52 +00001// RUN: %clang_cc1 -std=c++11 -fsyntax-only %s
2
3template < bool, class > struct A {};
4template < class, int > void f () {};
5template < class T, int >
6decltype (f < T, 1 >) f (T t, typename A < t == 0, int >::type) {};
7
8struct B {};
9
10int main ()
11{
12 f < B, 0 >;
13 return 0;
14}
15
16template <typename T>
17auto foo(T x) -> decltype((x == nullptr), *x) {
18 return *x;
19}
20
21void bar() {
22 foo(new int);
23}