[clang] [llvm] [clang-tools-extra] [compiler-rt] [flang] [libcxx] [Clang][Sema] Fix qualifier restriction of overriden methods (PR #71696)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 12 07:16:14 PST 2024
================
@@ -289,3 +289,29 @@ namespace PR8168 {
static void foo() {} // expected-error{{'static' member function 'foo' overrides a virtual function}}
};
}
+
+namespace T13 {
----------------
AaronBallman wrote:
I'd like to see additional test cases involving type aliases with and without qualifiers. e.g.,
```
namespace T13 {
using cip = const int *;
using ip = int *;
class A {
public:
virtual const int *foo();
virtual const int *bar();
virtual const int *baz();
virtual const int *quux();
};
class B: public A {
public:
cip foo() override; // Okay
const int *bar() override; // Okay
int *baz() override; // Diagnosed
ip quux() override; // Diagnosed
};
}
```
and similar for the class-based tests.
https://github.com/llvm/llvm-project/pull/71696
More information about the cfe-commits
mailing list