forked from OSchip/llvm-project
parent
651185bf47
commit
124f34c150
|
@ -1074,6 +1074,8 @@ def err_array_star_outside_prototype : Error<
|
|||
"star modifier used outside of function prototype">;
|
||||
def err_illegal_decl_pointer_to_reference : Error<
|
||||
"'%0' declared as a pointer to a reference">;
|
||||
def err_illegal_decl_mempointer_to_reference : Error<
|
||||
"'%0' declared as a member pointer to a reference">;
|
||||
def err_illegal_decl_mempointer_to_void : Error<
|
||||
"'%0' declared as a member pointer to void">;
|
||||
def err_illegal_decl_mempointer_in_nonclass : Error<
|
||||
|
|
|
@ -697,7 +697,7 @@ QualType Sema::BuildMemberPointerType(QualType T, QualType Class,
|
|||
// C++ 8.3.3p3: A pointer to member shall not pointer to ... a member
|
||||
// with reference type, or "cv void."
|
||||
if (T->isReferenceType()) {
|
||||
Diag(Loc, diag::err_illegal_decl_pointer_to_reference)
|
||||
Diag(Loc, diag::err_illegal_decl_mempointer_to_reference)
|
||||
<< (Entity? Entity.getAsString() : "type name");
|
||||
return QualType();
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ int B::*pbi; // expected-error {{expected a class or namespace}} \
|
|||
// expected-error{{does not point into a class}}
|
||||
int C::*pci; // expected-error {{'pci' does not point into a class}}
|
||||
void A::*pdv; // expected-error {{'pdv' declared as a member pointer to void}}
|
||||
int& A::*pdr; // expected-error {{'pdr' declared as a pointer to a reference}}
|
||||
int& A::*pdr; // expected-error {{'pdr' declared as a member pointer to a reference}}
|
||||
|
||||
void f() {
|
||||
// This requires tentative parsing.
|
||||
|
|
Loading…
Reference in New Issue