================
@@ -18469,9 +18469,22 @@ bool Sema::CheckOverridingFunctionReturnType(const 
CXXMethodDecl *New,
 
 
   // The new class type must have the same or less qualifiers as the old type.
-  if (NewClassTy.isMoreQualifiedThan(OldClassTy)) {
+  if (!OldClassTy.isAtLeastAsQualifiedAs(NewClassTy)) {
----------------
shafik wrote:

In the comment right above we can add a standard reference see: 
https://eel.is/c++draft/class.virtual#8

e.g.

```cpp
// C++ [class.virtual]p8:
//   The return type of an overriding function shall be either identical to the 
return type of the overridden function or [covariant]
```

https://github.com/llvm/llvm-project/pull/71696
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to