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
310
310
- Clang now correctly parses ``if constexpr `` expressions in immediate function context. (#GH123524)
311
311
- Fixed an assertion failure affecting code that uses C++23 "deducing this". (#GH130272)
312
312
- Clang now properly instantiates destructors for initialized members within non-delegating constructors. (#GH93251)
313
+ - Correctly diagnoses if unresolved using declarations shadows template paramters (#GH129411)
313
314
314
315
Bug Fixes to AST Handling
315
316
^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -12895,6 +12895,10 @@ NamedDecl *Sema::BuildUsingDeclaration(
12895
12895
SS, NameInfo, IdentLoc))
12896
12896
return nullptr;
12897
12897
12898
+ if (Previous.isSingleResult() &&
12899
+ Previous.getFoundDecl()->isTemplateParameter())
12900
+ DiagnoseTemplateParameterShadow(IdentLoc, Previous.getFoundDecl());
12901
+
12898
12902
if (HasTypenameKeyword) {
12899
12903
// FIXME: not all declaration name kinds are legal here
12900
12904
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
109
109
template <template <typename > class T > struct inner ; // expected-error{{declaration of 'T' shadows template parameter}}
110
110
};
111
111
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
+
112
120
// Non-type template parameters in scope
113
121
template <int Size>
114
122
void f (int & i) {
You can’t perform that action at this time.
0 commit comments