[Bug objc++/57607] g++ cannot distinguish obj-c message call from c++11 lambda

dougmencken at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Sep 7 14:36:00 GMT 2015


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

Douglas Mencken <dougmencken at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dougmencken at gmail dot com

--- Comment #1 from Douglas Mencken <dougmencken at gmail dot com> ---
I confirm it: still here with 4.9.2

$ g++ -std=c++11 test.mm && ./a.out
test.mm: In function 'int main()':
test.mm:8:10: error: expected identifier before ']' token
         [] () { std::cout << "Hello world!" << std::endl; }();
          ^
test.mm:8:10: error: '<expression error>' is not an Objective-C class name or
alias
test.mm:8:10: error: objective-c++ message argument(s) are expected before ']'
token
test.mm:8:61: error: expected primary-expression before ')' token
         [] () { std::cout << "Hello world!" << std::endl; }();
                                                             ^
$ g++ --version | head -1
g++ (GCC) 4.9.2

Issue also causes errors like

/usr/include/c++/4.9.2/bits/hashtable.h:878:15: error: objective-c++ message
argument(s) are expected before ']' token
          [this](const __node_type* __n)

/usr/include/c++/4.9.2/bits/hashtable.h:916:17: error: objective-c++ message
argument(s) are expected before ']' token
         [&__roan](const __node_type* __n)



More information about the Gcc-bugs mailing list