Mercurial > hg > CbC > CbC_llvm
diff clang/test/AST/ast-print-out-of-line-func.cpp @ 150:1d019706d866
LLVM10
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 15:10:13 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clang/test/AST/ast-print-out-of-line-func.cpp Thu Feb 13 15:10:13 2020 +0900 @@ -0,0 +1,95 @@ +// RUN: %clang_cc1 -ast-print -std=c++14 %s | FileCheck %s + +namespace ns { + +struct Wrapper { +class Inner { + Inner(); + Inner(int); + ~Inner(); + + void operator += (int); + + template<typename T> + void member(); + + static void staticMember(); + + operator int(); + + operator ns::Wrapper(); + // CHECK: operator ns::Wrapper() +}; +}; + +Wrapper::Inner::Inner() { } +// CHECK: Wrapper::Inner::Inner() + +void Wrapper::Inner::operator +=(int) { } +// CHECK: void Wrapper::Inner::operator+=(int) + +} + +ns::Wrapper::Inner::Inner(int) { } +// CHECK: ns::Wrapper::Inner::Inner(int) + +ns::Wrapper::Inner::~Inner() { } +// CHECK: ns::Wrapper::Inner::~Inner() + +template<typename T> +void ::ns::Wrapper::Inner::member() { } +// CHECK: template <typename T> void ::ns::Wrapper::Inner::member() + +ns::Wrapper::Inner::operator int() { return 0; } +// CHECK: ns::Wrapper::Inner::operator int() + +ns::Wrapper::Inner::operator ::ns::Wrapper() { return ns::Wrapper(); } +// CHECK: ns::Wrapper::Inner::operator ::ns::Wrapper() + +namespace ns { + +void Wrapper::Inner::staticMember() { } +// CHECK: void Wrapper::Inner::staticMember() + +} + +template<int x, typename T> +class TemplateRecord { + void function(); + template<typename U> void functionTemplate(T, U); +}; + +template<int x, typename T> +void TemplateRecord<x, T>::function() { } +// CHECK: template <int x, typename T> void TemplateRecord<x, T>::function() + +template<int x, typename T> +template<typename U> +void TemplateRecord<x, T>::functionTemplate(T, U) { } +// CHECK: template <int x, typename T> template <typename U> void TemplateRecord<x, T>::functionTemplate(T, U) + +template<> +class TemplateRecord<0, int> { + void function(); + template<typename U> void functionTemplate(int, U); +}; + +void TemplateRecord<0, int>::function() { } +// CHECK: void TemplateRecord<0, int>::function() + +template<typename U> +void TemplateRecord<0, int>::functionTemplate(int, U) { } +// CHECK: template <typename U> void TemplateRecord<0, int>::functionTemplate(int, U) + +template<typename T> +struct OuterTemplateRecord { + template<typename U> + struct Inner { + void function(); + }; +}; + +template<typename T> +template<typename U> +void OuterTemplateRecord<T>::Inner<U>::function() { } +// CHECK: template <typename T> template <typename U> void OuterTemplateRecord<T>::Inner<U>::function()