Skip to content

Commit

Permalink
Add more test coverage for D77598
Browse files Browse the repository at this point in the history
Add coverage to demonstrate why including the type of template
parameters is necessary to disambiguate function template
specializations.

Test courtesy of Richard Smith
  • Loading branch information
dwblaikie committed Nov 15, 2021
1 parent b2589e3 commit 50fdd7d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions clang/test/AST/ast-dump-templates.cpp
Expand Up @@ -93,3 +93,14 @@ void test() {
// CHECK1: {{^ }}template<> struct foo<1, 0 + 0L> {
template struct foo<1, 0 + 0L>;
}

namespace test5 {
template<long> void f() {}
void (*p)() = f<0>;
template<unsigned = 0> 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>()
}

0 comments on commit 50fdd7d

Please sign in to comment.