[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / SemaTemplate / instantiate-friend-function.cpp
blob1a923a2e92e04df99af3f511b9821a176e7e3a15
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2 // RUN: %clang_cc1 -S -triple %itanium_abi_triple -std=c++11 -emit-llvm %s -o - | FileCheck %s
3 // expected-no-diagnostics
5 namespace PR10856 {
6 template<typename T> class C;
8 template<typename S, typename R = S> C<R> operator - (C<S> m0, C<S> m1);
9 template<typename T> class C {
10 public:
11 template<typename S, typename R> friend C<R> operator - (C<S> m0, C<S> m1);
14 template<typename S, typename R> inline C<R> operator - (C<S> m0, C<S> m1) {
15 C<R> ret;
16 return ret;
20 int PR10856_main(int argc, char** argv) {
21 using namespace PR10856;
22 C<int> a;
23 a-a;
24 return 0;
27 // PR10856::C<int> PR10856::operator-<int, int>(PR10856::C<int>, PR10856::C<int>)
28 // CHECK: define {{.*}} @_ZN7PR10856miIiiEENS_1CIT0_EENS1_IT_EES5_
30 namespace PR10856_Root {
31 template<typename Value, typename Defaulted = void>
32 bool g(Value value);
34 template<typename ClassValue> class MyClass {
35 private:
36 template<typename Value, typename Defaulted>
37 friend bool g(Value value);
41 namespace PR10856_Root {
42 void f() {
43 MyClass<int> value;
44 g(value);
48 // bool PR10856_Root::g<PR10856_Root::MyClass<int>, void>(PR10856_Root::MyClass<int>)
49 // CHECK: call {{.*}} @_ZN12PR10856_Root1gINS_7MyClassIiEEvEEbT_
51 namespace PR43400 {
52 template<typename T> struct X {
53 friend void f() = delete;
55 X<int> xi;