Krystian Stasiowski b24650e814
Reapply "[Clang][Sema] Always use latest redeclaration of primary template" (#114569)
This patch reapplies #114258, fixing an infinite recursion bug in
`ASTImporter` that occurs when importing the primary template of a class
template specialization when the latest redeclaration of that template
is a friend declaration in the primary template.
2024-11-01 16:15:33 -04:00

9 lines
287 B
C++

// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/class-template-spec.cpp
// RUN: %clang_cc1 -ast-merge %t.1.ast -fsyntax-only -verify %s
// expected-no-diagnostics
template struct N0::A<short>;
template struct N1::A<short>;
template struct N2::A<short>;
template struct N3::B<short>;