llvm-capstone/clang/test/SemaTemplate/default-arguments-ast-print.cpp
Pratyush Das c33ebad735 Print default template argument if manually specified in typedef declaration.
If a default template type argument is manually specified to be of the default
type, then it is committed when printing the template.

Differential revision: https://reviews.llvm.org/D103040
2021-06-29 14:57:26 +00:00

25 lines
535 B
C++

// RUN: %clang_cc1 -fsyntax-only -ast-print %s | FileCheck %s
template <typename T, typename U = double> class Foo;
template <> class Foo<int, double> { int method1(); };
using int_type = int;
int Foo<int_type, double>::method1() {
// CHECK: int Foo<int_type, double>::method1()
return 10;
}
int test_typedef() {
typedef Foo<int, double> TypedefArg;
// CHECK: typedef Foo<int, double> TypedefArg;
return 10;
}
int test_typedef2() {
typedef Foo<int> TypedefArg;
// CHECK: typedef Foo<int> TypedefArg;
return 10;
}