[PATCH] D39937: [Sema] Improve diagnostics for const- and ref-qualified member functions
Jacob Bandes-Storch via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 16 21:07:04 PST 2017
jtbandes added inline comments.
================
Comment at: test/CXX/over/over.match/over.match.funcs/p4-0x.cpp:22-24
+ void lvalue() &; // expected-note 2 {{'lvalue' declared here}}
+ void const_lvalue() const&;
+ void rvalue() &&; // expected-note {{'rvalue' declared here}}
----------------
aaron.ballman wrote:
> Can you add examples that cover the other diagnostic wordings as well (volatile, restrict, combinations, etc)?
I've been working on this, but I actually can't trigger the `restrict` variants. Do you know whether this is something that's expected to work? The implicit object param doesn't seem to retain its restrict-ness (full disclosure, I have almost no prior experience with `restrict`...):
```
void c() const;
void v() volatile;
void r() __restrict__;
void cr() const __restrict__;
void cv() const volatile;
void vr() volatile __restrict__;
void cvr() const volatile __restrict__;
```
```
void test_diagnostics(const volatile X0 &__restrict__ cvr) {
cvr.g(); // expected-error {{not marked const, volatile, or restrict}} -- actually produces "not marked const or volatile"
cvr.c(); // expected-error {{not marked volatile or restrict}} -- actually produces "not marked volatile"
cvr.v(); // expected-error {{not marked const or restrict}} -- actually produces "not marked const"
cvr.r(); // expected-error {{not marked const or volatile}}
cvr.cr(); // expected-error {{not marked volatile}}
cvr.cv(); // expected-error {{not marked restrict}} -- actually produces no error
cvr.vr(); // expected-error {{not marked const}}
cvr.cvr();
}
```
https://reviews.llvm.org/D39937
More information about the cfe-commits
mailing list