This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/12577] typeof does not qualify as unqualified-id in certain contexts


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12577

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-20 01:29:24 UTC ---
t.cc:26:45: error: redefinition of âvoid (bar::* const foo<bar,
int>::setter)(int)â
t.cc:17:46: error: âvoid (bar::* const foo<bar, int>::setter)(int)â previously
declared here
t.cc:37:52: error: expected unqualified-id before â*â token
t.cc:37:54: error: expected primary-expression before âconstâ
t.cc:37:72: error: âJustAPointer<bar>()->bar::getfoobar()â cannot be used as a
function
t.cc:37:74: error: expected primary-expression before âvoidâ
t.cc:38:7: error: expected unqualified-id before â=â token
t.cc:42:52: error: expected unqualified-id before â*â token
t.cc:42:54: error: expected primary-expression before âconstâ
t.cc:42:68: error: expected primary-expression before â__typeof__â
t.cc:42:121: error: âJustAPointer<bar>()->bar::getfoobar()â cannot be used as a
function
t.cc:42:123: error: expected primary-expression before âvoidâ
t.cc:43:5: error: expected unqualified-id before â=â token

--- CUT ---
If I use decltype instead of typeof we get:
t.cc:27:45: error: redefinition of âvoid (bar::* const foo<bar,
int>::setter)(int)â
t.cc:18:46: error: âvoid (bar::* const foo<bar, int>::setter)(int)â previously
declared here
t.cc:43:127: error: conflicting declaration âint (bar::* const foo<bar,
int>::setter)()â
t.cc:18:46: error: âfoo<bar, int>::setterâ has a previous declaration as âvoid
(bar::* const foo<bar, int>::setter)(int)â

Which looks correct so I am going to close as won't fix as decltype is the more
correct choice now.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]