public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/48507] New: Functor Declared In Templated Method Not Recognized By std::sort
@ 2011-04-07 22:17 overseer55 at gmail dot com
  2011-04-07 22:19 ` [Bug libstdc++/48507] " overseer55 at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: overseer55 at gmail dot com @ 2011-04-07 22:17 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Functor Declared In Templated Method Not Recognized By
                    std::sort
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: overseer55@gmail.com


Created attachment 23921
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23921
Source code (19 lines long)

> g++ -v 

COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/tools/gcc/4.5.2/linux64/libexec/gcc/x86_64-unknown-linux-gnu/4.5.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/tools/gcc/4.5.2/linux64
--with-gmp=/build/swbuild/tools/gmp/4.3.2/linux64
--with-mpfr=/build/swbuild/tools/mpfr/3.0.0/linux64
--with-mpc=/build/swbuild/tools/mpc/0.8.2/linux64 --enable-languages=c,c++
--with-binutils=/tools/binutils/2.18.50/linux64
Thread model: posix
gcc version 4.5.2 (GCC) 

> g++ test.cpp

test.cpp: In member function ‘void A::fn(const _Pr&) [with _Pr = LT]’:
test.cpp:18:51:   instantiated from here
test.cpp:15:4: error: no matching function for call to
‘sort(std::vector<int>::iterator, std::vector<int>::iterator, A::fn(const _Pr&)
[with _Pr = LT]::sub_pred)’

Although I'm not enough of an expert on the STL implementation to determine
whether this program is legal, I do know that this program compiles using the
MSVC implementation of STL.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/48507] Functor Declared In Templated Method Not Recognized By std::sort
  2011-04-07 22:17 [Bug libstdc++/48507] New: Functor Declared In Templated Method Not Recognized By std::sort overseer55 at gmail dot com
@ 2011-04-07 22:19 ` overseer55 at gmail dot com
  2011-04-07 22:21 ` pinskia at gcc dot gnu.org
  2011-04-08  9:20 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: overseer55 at gmail dot com @ 2011-04-07 22:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from overseer55 at gmail dot com 2011-04-07 22:19:12 UTC ---
Comment on attachment 23921
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23921
Source code (19 lines long)

Ignore the 'private' in sub_pred...I originally had it as a class.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/48507] Functor Declared In Templated Method Not Recognized By std::sort
  2011-04-07 22:17 [Bug libstdc++/48507] New: Functor Declared In Templated Method Not Recognized By std::sort overseer55 at gmail dot com
  2011-04-07 22:19 ` [Bug libstdc++/48507] " overseer55 at gmail dot com
@ 2011-04-07 22:21 ` pinskia at gcc dot gnu.org
  2011-04-08  9:20 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-04-07 22:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-04-07 22:21:42 UTC ---
This is invalid C++03 and C++98.  The reason is that sub_pred is a local class
which is not a valid template argument type.  C++0x allows this though.  So
compiling with -std=c++0x and it works.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/48507] Functor Declared In Templated Method Not Recognized By std::sort
  2011-04-07 22:17 [Bug libstdc++/48507] New: Functor Declared In Templated Method Not Recognized By std::sort overseer55 at gmail dot com
  2011-04-07 22:19 ` [Bug libstdc++/48507] " overseer55 at gmail dot com
  2011-04-07 22:21 ` pinskia at gcc dot gnu.org
@ 2011-04-08  9:20 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2011-04-08  9:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-04-08 09:20:12 UTC ---
Yep. The MSVC compiler accepts this as an extension enabled by default, but G++
only accepts it in C++0x mode


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-08  9:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-07 22:17 [Bug libstdc++/48507] New: Functor Declared In Templated Method Not Recognized By std::sort overseer55 at gmail dot com
2011-04-07 22:19 ` [Bug libstdc++/48507] " overseer55 at gmail dot com
2011-04-07 22:21 ` pinskia at gcc dot gnu.org
2011-04-08  9:20 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).