From 50fdd7df827137c8465abafa82a6bae7c87096c5 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sun, 14 Nov 2021 21:09:11 -0800 Subject: [PATCH] Add more test coverage for D77598 Add coverage to demonstrate why including the type of template parameters is necessary to disambiguate function template specializations. Test courtesy of Richard Smith --- clang/test/AST/ast-dump-templates.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/clang/test/AST/ast-dump-templates.cpp b/clang/test/AST/ast-dump-templates.cpp index b08bc76ed1794..3d26eb917c120 100644 --- a/clang/test/AST/ast-dump-templates.cpp +++ b/clang/test/AST/ast-dump-templates.cpp @@ -93,3 +93,14 @@ void test() { // CHECK1: {{^ }}template<> struct foo<1, 0 + 0L> { template struct foo<1, 0 + 0L>; } + +namespace test5 { +template void f() {} +void (*p)() = f<0>; +template void f() {} +void (*q)() = f<>; +// Not perfect - this code in the dump would be ambiguous, but it's the best we +// can do to differentiate these two implicit specializations. +// CHECK1: template<> void f<0L>() +// CHECK1: template<> void f<0U>() +}