https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49531

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-08-18
                 CC|                            |egallager at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> ---
Confirmed, clang accepts it with both standards:

$ /usr/local/bin/g++ -c -Wall -Wextra -pedantic -std=c++03 49531.cc
49531.cc: In function ‘void f()’:
49531.cc:5:12: error: statement cannot resolve address of overloaded function
 void f() { &A::operator int; }
            ^~
$ /usr/local/bin/g++ -c -Wall -Wextra -pedantic -std=c++0x 49531.cc
49531.cc: In function ‘void f()’:
49531.cc:5:12: error: statement cannot resolve address of overloaded function
 void f() { &A::operator int; }
            ^~
$ /sw/opt/llvm-3.1/bin/clang++ -c -Wall -Wextra -pedantic -std=c++03 49531.cc
49531.cc:5:12: warning: expression result unused [-Wunused-value]
void f() { &A::operator int; }
           ^~~~~~~~~~~~~~~~
1 warning generated.
$ /sw/opt/llvm-3.1/bin/clang++ -c -Wall -Wextra -pedantic -std=c++0x 49531.cc
49531.cc:5:12: warning: expression result unused [-Wunused-value]
void f() { &A::operator int; }
           ^~~~~~~~~~~~~~~~
1 warning generated.
$

(although in my opinion the code still just looks weird...)

Reply via email to