[cfe-commits] r89255 - in /cfe/trunk: lib/Sema/SemaExprCXX.cpp test/SemaCXX/cxx-member-pointer-op.cpp
Fariborz Jahanian
fjahanian at apple.com
Wed Nov 18 14:16:18 PST 2009
Author: fjahanian
Date: Wed Nov 18 16:16:17 2009
New Revision: 89255
URL: http://llvm.org/viewvc/llvm-project?rev=89255&view=rev
Log:
ignore parens surounding the type when diagnosing
pointer-to-member cast types used in expressions.
Modified:
cfe/trunk/lib/Sema/SemaExprCXX.cpp
cfe/trunk/test/SemaCXX/cxx-member-pointer-op.cpp
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=89255&r1=89254&r2=89255&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Wed Nov 18 16:16:17 2009
@@ -1445,7 +1445,7 @@
}
}
- if (isa<CXXZeroInitValueExpr>(rex)) {
+ if (isa<CXXZeroInitValueExpr>(rex->IgnoreParens())) {
// Diagnose use of pointer-to-member type which when used as
// the functional cast in a pointer-to-member expression.
Diag(Loc, diag::err_pointer_to_member_type) << isIndirect;
Modified: cfe/trunk/test/SemaCXX/cxx-member-pointer-op.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx-member-pointer-op.cpp?rev=89255&r1=89254&r2=89255&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/cxx-member-pointer-op.cpp (original)
+++ cfe/trunk/test/SemaCXX/cxx-member-pointer-op.cpp Wed Nov 18 16:16:17 2009
@@ -11,6 +11,8 @@
c->*pmfc(); // expected-error {{invalid use of pointer to member type after ->*}}
C c1;
c1.*pmfc(); // expected-error {{invalid use of pointer to member type after .*}}
+ c->*(pmfc()); // expected-error {{invalid use of pointer to member type after ->*}}
+ c1.*((pmfc())); // expected-error {{invalid use of pointer to member type after .*}}
}
int a(C* x) {
More information about the cfe-commits
mailing list