1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 | FileCheck %s 2*f4a2713aSLionel Sambuc 3*f4a2713aSLionel Sambuc struct B { 4*f4a2713aSLionel Sambuc template <class U> U f(); 5*f4a2713aSLionel Sambuc }; 6*f4a2713aSLionel Sambuc 7*f4a2713aSLionel Sambuc struct A { 8*f4a2713aSLionel Sambuc B b; 9*f4a2713aSLionel Sambuc // implicitly rewritten to (*this).b.f<U>() 10*f4a2713aSLionel Sambuc template <class U> auto f() -> decltype (b.f<U>()); 11*f4a2713aSLionel Sambuc template <class U> auto g() -> decltype (this->b.f<U>()); 12*f4a2713aSLionel Sambuc }; 13*f4a2713aSLionel Sambuc main()14*f4a2713aSLionel Sambucint main() { 15*f4a2713aSLionel Sambuc A a; 16*f4a2713aSLionel Sambuc // CHECK: call i32 @_ZN1A1fIiEEDTcldtdtdefpT1b1fIT_EEEv 17*f4a2713aSLionel Sambuc a.f<int>(); 18*f4a2713aSLionel Sambuc // CHECK: call i32 @_ZN1A1gIiEEDTcldtptfpT1b1fIT_EEEv 19*f4a2713aSLionel Sambuc a.g<int>(); 20*f4a2713aSLionel Sambuc } 21