llvm-project/clang/test/Sema/nullability-and-template-deduction.cpp
Ilya Biryukov d02786e778
[Sema] Handle AttributedType in template deduction with derived-to-base conversions (#134361)
Fix #134356.

We accidentally skipped checking derived-to-base conversions because
deduction did not strip sugar in the relevant code. This caused
deduction failures when a parameter type had an attribute.
2025-04-04 14:23:55 +02:00

17 lines
309 B
C++

// RUN: %clang_cc1 -fsyntax-only %s -verify
// expected-no-diagnostics
template <class T> struct Base {};
template <class T> struct Derived : Base<T> {};
template <class T> void foo(Base<T> *_Nonnull);
template <class T> void bar(Base<T> *);
void test() {
Derived<int> d;
foo(&d);
bar(&d);
}