File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -310,6 +310,7 @@ Bug Fixes to C++ Support
310310- Clang now correctly parses ``if constexpr `` expressions in immediate function context. (#GH123524)
311311- Fixed an assertion failure affecting code that uses C++23 "deducing this". (#GH130272)
312312- Clang now properly instantiates destructors for initialized members within non-delegating constructors. (#GH93251)
313+ - Correctly diagnoses if unresolved using declarations shadows template paramters (#GH129411)
313314
314315Bug Fixes to AST Handling
315316^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -12895,6 +12895,10 @@ NamedDecl *Sema::BuildUsingDeclaration(
1289512895 SS, NameInfo, IdentLoc))
1289612896 return nullptr;
1289712897
12898+ if (Previous.isSingleResult() &&
12899+ Previous.getFoundDecl()->isTemplateParameter())
12900+ DiagnoseTemplateParameterShadow(IdentLoc, Previous.getFoundDecl());
12901+
1289812902 if (HasTypenameKeyword) {
1289912903 // FIXME: not all declaration name kinds are legal here
1290012904 D = UnresolvedUsingTypenameDecl::Create(Context, CurContext,
Original file line number Diff line number Diff line change @@ -109,6 +109,14 @@ template<template<typename> class T> struct shadow8 { // expected-note{{template
109109 template <template <typename > class T > struct inner ; // expected-error{{declaration of 'T' shadows template parameter}}
110110};
111111
112+ template <class >
113+ class shadow9_ ;
114+
115+ template <class T > // expected-note{{template parameter is declared here}}
116+ class shadow9 : public shadow9_ <T> {
117+ using typename shadow9_<T>::T; // expected-error{{declaration of 'T' shadows template parameter}}
118+ };
119+
112120// Non-type template parameters in scope
113121template <int Size>
114122void f (int & i) {
You can’t perform that action at this time.
0 commit comments