diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp index 954479fdf0e41..06233b58fe3b2 100644 --- a/clang/lib/AST/DeclPrinter.cpp +++ b/clang/lib/AST/DeclPrinter.cpp @@ -1927,7 +1927,8 @@ void DeclPrinter::VisitNonTypeTemplateParmDecl( void DeclPrinter::VisitTemplateTemplateParmDecl( const TemplateTemplateParmDecl *TTPD) { VisitTemplateDecl(TTPD); - if (TTPD->hasDefaultArgument() && !TTPD->defaultArgumentWasInherited()) { + if (TTPD->hasDefaultArgument() && !Policy.SuppressDefaultTemplateArguments && + !TTPD->defaultArgumentWasInherited()) { Out << " = "; TTPD->getDefaultArgument().getArgument().print(Policy, Out, /*IncludeType=*/false); diff --git a/clang/test/CodeGenSYCL/integration_header.cpp b/clang/test/CodeGenSYCL/integration_header.cpp index 72e409430aee9..c9af016e2007c 100644 --- a/clang/test/CodeGenSYCL/integration_header.cpp +++ b/clang/test/CodeGenSYCL/integration_header.cpp @@ -5,8 +5,9 @@ // // CHECK: // Forward declarations of templated kernel function types: // CHECK: class first_kernel; +// CHECK-NEXT: template struct point; // CHECK-NEXT: namespace second_namespace { -// CHECK-NEXT: template class second_kernel; +// CHECK-NEXT: template typename U> class second_kernel; // CHECK-NEXT: } // CHECK-NEXT: namespace template_arg_ns { // CHECK-NEXT: template struct namespaced_arg; @@ -17,7 +18,7 @@ // CHECK: static constexpr // CHECK-NEXT: const char* const kernel_names[] = { // CHECK-NEXT: "_ZTSZ4mainE12first_kernel", -// CHECK-NEXT: "_ZTSN16second_namespace13second_kernelIcEE", +// CHECK-NEXT: "_ZTSN16second_namespace13second_kernelIc5pointEE", // CHECK-NEXT: "_ZTS13fourth_kernelIJN15template_arg_ns14namespaced_argILi1EEEEE" // CHECK-NEXT: "_ZTSZ4mainE16accessor_in_base" // CHECK-NEXT: "_ZTSZ4mainE15annotated_types" @@ -36,7 +37,7 @@ // CHECK-NEXT: { kernel_param_kind_t::kind_accessor, 6112, 24 }, // CHECK-NEXT: { kernel_param_kind_t::kind_sampler, 8, 40 }, // CHECK-EMPTY: -// CHECK-NEXT: //--- _ZTSN16second_namespace13second_kernelIcEE +// CHECK-NEXT: //--- _ZTSN16second_namespace13second_kernelIc5pointEE // CHECK-NEXT: { kernel_param_kind_t::kind_std_layout, 4, 0 }, // CHECK-NEXT: { kernel_param_kind_t::kind_accessor, 6112, 4 }, // CHECK-NEXT: { kernel_param_kind_t::kind_sampler, 8, 16 }, @@ -66,7 +67,7 @@ // CHECK-NEXT: }; // // CHECK: template <> struct KernelInfo { -// CHECK: template <> struct KernelInfo<::second_namespace::second_kernel> { +// CHECK: template <> struct KernelInfo<::second_namespace::second_kernel> { // CHECK: template <> struct KernelInfo<::fourth_kernel<::template_arg_ns::namespaced_arg<1>>> { #include "Inputs/sycl.hpp" @@ -79,7 +80,7 @@ struct x {}; template struct point {}; namespace second_namespace { -template +template typename U = point> class second_kernel; }