1 // RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
2 // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
3 // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
4 // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
5 // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
6 // RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
7 // RUN: %clang_cc1 -std=c++2c -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s
9 // expected-no-diagnostics
11 namespace dr873
{ // dr873: yes
12 #if __cplusplus >= 201103L
13 template <typename T
> void f(T
&&);
14 template <> void f(int &) {} // #1
15 template <> void f(int &&) {} // #2
17 f(i
); // calls f<int&>(int&), i.e., #1
18 #pragma clang __debug dump f(i)
19 // CHECK: CallExpr {{.*}}
20 // CHECK-NEXT: |-ImplicitCastExpr {{.*}}
21 // CHECK-NEXT: | `-DeclRefExpr {{.*}} 'f' 'void (int &)' {{.*}}
23 f(0); // calls f<int>(int&&), i.e., #2
24 #pragma clang __debug dump f(0)
25 // CHECK: CallExpr {{.*}}
26 // CHECK-NEXT: |-ImplicitCastExpr {{.*}}
27 // CHECK-NEXT: | `-DeclRefExpr {{.*}} 'f' 'void (int &&)' {{.*}}