Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s |
Douglas Gregor | f801dcf | 2010-07-15 18:35:15 +0000 | [diff] [blame] | 2 | |
| 3 | // PR5290 |
| 4 | int const f0(); |
| 5 | void f0_test() { |
Douglas Gregor | 35e12c9 | 2010-07-15 18:47:04 +0000 | [diff] [blame] | 6 | decltype(0, f0()) i = 0; |
Douglas Gregor | f801dcf | 2010-07-15 18:35:15 +0000 | [diff] [blame] | 7 | i = 0; |
| 8 | } |
| 9 | |
| 10 | struct A { int a[1]; A() { } }; |
| 11 | typedef A const AC; |
| 12 | int &f1(int*); |
| 13 | float &f2(int const*); |
| 14 | |
| 15 | void test_f2() { |
| 16 | float &fr = f2(AC().a); |
| 17 | } |
| 18 | |
Francois Pichet | e3d49b4 | 2011-06-19 08:02:06 +0000 | [diff] [blame] | 19 | namespace pr10154 { |
| 20 | class A{ |
| 21 | A(decltype(nullptr) param); |
| 22 | }; |
Richard Smith | fa16125 | 2012-01-15 06:24:57 +0000 | [diff] [blame] | 23 | } |
| 24 | |
| 25 | template<typename T> struct S {}; |
| 26 | template<typename T> auto f(T t) -> decltype(S<int>(t)) { |
| 27 | using U = decltype(S<int>(t)); |
| 28 | using U = S<int>; |
| 29 | return S<int>(t); |
| 30 | } |