File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -127,14 +127,15 @@ void type_conversions_2()
127127#endif
128128
129129// --- VIRTUAL METHODS ---
130- // Attributes propagate to overridden methods, so no diagnostics except for conflicts .
130+ // Attributes propagate to overridden methods.
131131// Check this in the syntax tests too.
132132#ifdef __cplusplus
133133struct Base {
134134 virtual void f1 ();
135135 virtual void nonblocking () noexcept [[clang::nonblocking]]; // expected-note {{overridden virtual function is here}}
136136 virtual void nonallocating () noexcept [[clang::nonallocating]]; // expected-note {{overridden virtual function is here}}
137137 virtual void f2 () [[clang::nonallocating]]; // expected-note {{previous declaration is here}}
138+ virtual void f3 () [[clang::nonblocking]]; // expected-note {{overridden virtual function is here}}
138139};
139140
140141struct Derived : public Base {
@@ -143,6 +144,11 @@ struct Derived : public Base {
143144 void nonallocating () noexcept override ; // expected-warning {{overriding function is missing 'nonallocating' attribute from base declaration}}
144145 void f2 () [[clang::allocating]] override ; // expected-warning {{effects conflict when merging declarations; kept 'allocating', discarded 'nonallocating'}}
145146};
147+
148+ template <bool B>
149+ struct TDerived : public Base {
150+ void f3 () [[clang::nonblocking(B)]] override ; // expected-warning {{attribute 'nonblocking' on overriding function conflicts with base declaration}}
151+ };
146152#endif // __cplusplus
147153
148154// --- REDECLARATIONS ---
You can’t perform that action at this time.
0 commit comments