File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -273,6 +273,9 @@ Attribute Changes in Clang
273273 not change the behaviour of the compiler, as this was true for previous
274274 versions.
275275
276+ - Fix a bug where clang doesn't automatically apply the ``[[gsl::Owner]] `` or
277+ ``[[gsl::Pointer]] `` to STL explicit template specialization decls. (#GH109442)
278+
276279Improvements to Clang's diagnostics
277280-----------------------------------
278281
Original file line number Diff line number Diff line change @@ -8631,6 +8631,7 @@ DeclResult Sema::ActOnClassTemplateSpecialization(
86318631 return SkipBody->Previous ;
86328632
86338633 Specialization->setInvalidDecl (Invalid);
8634+ inferGslOwnerPointerAttribute (Specialization);
86348635 return Specialization;
86358636}
86368637
Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ class vector {
2727static_assert (sizeof (vector<int >), " " ); // Force instantiation.
2828static_assert (sizeof (vector<int >::iterator), " " ); // Force instantiation.
2929
30+ template <>
31+ class vector <bool > {};
32+ // CHECK: ClassTemplateSpecializationDecl {{.*}} vector
33+ // CHECK: OwnerAttr {{.*}}
34+
3035// If std::container::iterator is a using declaration, attributes are inferred
3136// for the underlying class.
3237template <typename T>
@@ -173,6 +178,18 @@ class reference_wrapper;
173178class some_unknown_type ;
174179// CHECK: CXXRecordDecl {{.*}} some_unknown_type
175180
181+ using size_t = unsigned ;
182+ inline constexpr size_t dynamic_extent = -1 ;
183+ template <typename _Tp, size_t _Extent = dynamic_extent>
184+ class span ;
185+ // CHECK: CXXRecordDecl {{.*}} span
186+ // CHECK: PointerAttr {{.*}}
187+
188+
189+ template <typename _Tp>
190+ struct span <_Tp, dynamic_extent> {};
191+ // CHECK: ClassTemplatePartialSpecializationDecl {{.*}} span
192+ // CHECK: PointerAttr {{.*}}
176193} // namespace std
177194
178195namespace user {
You can’t perform that action at this time.
0 commit comments