public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/43975]  New: g++ function resolution failure
@ 2010-05-03 12:00 internet at calumgrant dot net
  2010-05-03 12:07 ` [Bug c++/43975] " paolo dot carlini at oracle dot com
  0 siblings, 1 reply; 2+ messages in thread
From: internet at calumgrant dot net @ 2010-05-03 12:00 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1849 bytes --]

The following does not compile (minimal test case):

#include <algorithm>

int main()
{
    int vec;

    struct comparator
    {
        bool operator()(int a, int b) const { return a<b; }
    };

    std::sort(&vec, &vec, comparator());
}

Result is:
test.cpp: In function ‘int main()’:
test.cpp:13: error: no matching function for call to ‘sort(int*, int*,
main()::comparator)’

The following does compile:

#include <algorithm>

struct comparator
{
    bool operator()(int a, int b) const { return a<b; }
};

int main()
{
    int vec;

    std::sort(&vec, &vec, comparator());
}

Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--enable-multiarch --enable-linker-build-id --with-system-zlib
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc
--enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic
--enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu
--target=i486-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)


-- 
           Summary: g++ function resolution failure
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: internet at calumgrant dot net
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


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


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

* [Bug c++/43975] g++ function resolution failure
  2010-05-03 12:00 [Bug c++/43975] New: g++ function resolution failure internet at calumgrant dot net
@ 2010-05-03 12:07 ` paolo dot carlini at oracle dot com
  0 siblings, 0 replies; 2+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-05-03 12:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from paolo dot carlini at oracle dot com  2010-05-03 12:06 -------
Yes, in C++03 you cannot instantiate a template with a local type. C++1x will
be different.


-- 

paolo dot carlini at oracle dot com changed:

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


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


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

end of thread, other threads:[~2010-05-03 12:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-03 12:00 [Bug c++/43975] New: g++ function resolution failure internet at calumgrant dot net
2010-05-03 12:07 ` [Bug c++/43975] " paolo dot carlini at oracle dot com

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).