blob: a1200e08200d0e1cd71697fc43232b24e06ef67a [file] [log] [blame]
Richard Smith762bb9d2011-10-13 22:29:44 +00001// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
Douglas Gregorf801dcf2010-07-15 18:35:15 +00002
3// PR5290
4int const f0();
5void f0_test() {
Douglas Gregor35e12c92010-07-15 18:47:04 +00006 decltype(0, f0()) i = 0;
Douglas Gregorf801dcf2010-07-15 18:35:15 +00007 i = 0;
8}
9
10struct A { int a[1]; A() { } };
11typedef A const AC;
12int &f1(int*);
13float &f2(int const*);
14
15void test_f2() {
16 float &fr = f2(AC().a);
17}
18
Francois Pichete3d49b42011-06-19 08:02:06 +000019namespace pr10154 {
20 class A{
21 A(decltype(nullptr) param);
22 };
Richard Smithfa161252012-01-15 06:24:57 +000023}
24
25template<typename T> struct S {};
26template<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}