On Tue, Mar 23, 2021 at 09:05:42AM -0400, Jason Merrill via Gcc-patches wrote: > On 3/9/21 10:22 PM, Marek Polacek wrote: > > In GCC 10, I introduced cp_warn_deprecated_use_scopes so that we can > > handle attribute deprecated on a namespace declaration. This > > function walks the decl's contexts so that we warn for code like > > > > namespace [[deprecated]] N { struct S { }; } > > N::S s; > > > > We call cp_warn_deprecated_use_scopes when we encounter a TYPE_DECL. > > Hmm, I'd think we should warn about N as a consequence of seeing N::, not > because we are using S. For instance, in > > namespace [[deprecated]] N { struct S { }; } > using namespace N; > S s; > > we should warn about the using-directive, but not also the declaration of > 's'.
I agree, opened 99729. > But the patch is OK, that's just a possible future direction. Thanks, pushed. Marek