Page MenuHomePhabricator

Allow pointer to static member function
AbandonedPublic

Authored by Manna on Mar 12 2019, 8:25 PM.

Details

Summary

This patch allows pointer to static member function and fixes the bug in Bugzilla (https://bugs.llvm.org/show_bug.cgi?id=28419).

This is valid C++ codes. Both GCC and MSVC accepts this.

Diff Detail

Event Timeline

Manna created this revision.Mar 12 2019, 8:25 PM
majnemer added inline comments.Mar 12 2019, 8:36 PM
lib/Sema/SemaOverload.cpp
10996

Is this still used after you deleted that user of this?

This is valid C++ codes. Both GCC and MSVC accepts this.

Just because GCC and MSVC accept something doesn't always mean it's valid C++ code; do you have references to where this is allowed by the standard? It seems like this changes the behavior of at least one DR, which is why I'm wondering about it. By my strict reading of the standard, this actually isn't valid C++ (though it seems like it could be a reasonable extension to support).

lib/Sema/SemaExpr.cpp
11881

Missing grammatical correctness. How about "Explicitly accessing a static member function." instead?

test/CXX/drs/dr0xx.cpp
754–755

This seems to have changed the behavior of DR61: https://wg21.cmeerw.net/cwg/issue61
Was this DR later superseded by something (I didn't spot anything -- the use of "name" still exists in http://eel.is/c++draft/over.over#1.sentence-1)?

test/CXX/drs/dr1xx.cpp
127–128

Spurious whitespace changes.

Manna abandoned this revision.Apr 11 2019, 7:48 PM

This is valid C++ codes. Both GCC and MSVC accepts this.

Just because GCC and MSVC accept something doesn't always mean it's valid C++ code; do you have references to where this is allowed by the standard? It seems like this changes the behavior of at least one DR, which is why I'm wondering about it. By my strict reading of the standard, this actually isn't valid C++ (though it seems like it could be a reasonable extension to support).

Thanks Aaron.
Yes, my proposed changes are not correct. This changes the behavior of one DR, which is not allowed and valid by C++ code. I do not find any references to where this is allowed by the standard. I tested my proposed changes with gcc8 and latest MSVS environment. I was not aware that both GCC and MSVC are violating C++ Standard. Clang is following the standard.

I am withdrawing my patches and this feature will not be supported in Clang.