Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / over / over.match / over.match.best / over.ics.rank / p3-0x.cpp
blobf813305b4a19f19d1d5305967e3a9fc46ae00368
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
2 // expected-no-diagnostics
3 namespace std_example {
4 int i;
5 int f1();
6 int&& f2();
7 int &g(const int &);
8 float &g(const int &&);
9 int &j = g(i);
10 float &k = g(f1());
11 float &l = g(f2());
13 int &g2(const int &);
14 float &g2(int &&);
15 int &j2 = g2(i);
16 float &k2 = g2(f1());
17 float &l2 = g2(f2());
19 // FIXME: We don't support ref-qualifiers yet.
20 #if 0
21 struct A {
22 A& operator<<(int);
23 void p() &;
24 void p() &&;
27 A& operator<<(A&&, char);
28 A() << 1;
29 A() << 'c';
30 A a;
31 a << 1;
32 a << 'c';
33 A().p();
34 a.p();
35 #endif
38 template<typename T>
39 struct remove_reference {
40 typedef T type;
43 template<typename T>
44 struct remove_reference<T&> {
45 typedef T type;
48 template<typename T>
49 struct remove_reference<T&&> {
50 typedef T type;
53 namespace FunctionReferencesOverloading {
54 template<typename T> int &f(typename remove_reference<T>::type&);
55 template<typename T> float &f(typename remove_reference<T>::type&&);
57 void test_f(int (&func_ref)(int)) {
58 int &ir = f<int (&)(int)>(func_ref);