public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53039] New: [C++11]including <functional> breaks std::is_convertible with template-pack expansion
@ 2012-04-19  7:57 mitchnull+gcc at gmail dot com
  2012-04-19  8:00 ` [Bug c++/53039] " mitchnull+gcc at gmail dot com
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: mitchnull+gcc at gmail dot com @ 2012-04-19  7:57 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53039
           Summary: [C++11]including <functional> breaks
                    std::is_convertible with template-pack expansion
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mitchnull+gcc@gmail.com


Created attachment 27185
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27185
test code

#include <functional> in the following code causes compile failure. Without the
include, it compiles fine:

#include <type_traits>
#include <functional> // without this include, it compiles

template <bool... Bs_>
struct Bools {
    static const bool value = true;
};

template <typename... Ts_>
struct Types {
    template <typename... Us,
             typename std::enable_if<
                 Bools<std::is_convertible<Us, Ts_>::value...>::value,
                 bool>::type = false>
    int foo(Us&&...) {
        return sizeof...(Us);
    }
};

int main() {
    Types<int, int> t;
    return t.foo(1, 1);
}


Output:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper 
Target: x86_64-unknown-linux-gnu
Configured with: /build/src/gcc-4.7-20120324/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--enable-libstdcxx-time --enable-gnu-unique-object --enable-linker-build-id
--with-ppl --enable-cloog-backend=isl --enable-lto --enable-gold
--enable-ld=default --enable-plugin --with-plugin-ld=ld.gold
--with-linker-hash-style=gnu --disable-multilib --disable-libssp
--disable-build-with-cxx --disable-build-poststage1-with-cxx
--enable-checking=release
Thread model: posix
gcc version 4.8.0 20120407 (experimental) [trunk revision 186212] (Debian
20120407-1)

$ /usr/lib/gcc-snapshot/bin/g++ -std=c++11 functional_bug.cpp
functional_bug.cpp: In instantiation of 'struct Types<int, int>':
functional_bug.cpp:21:21:   required from here
functional_bug.cpp:15:9: error: wrong number of template arguments (3, should
be 2)
In file included from functional_bug.cpp:1:0:
/usr/lib/gcc-snapshot/lib/gcc/i486-linux-gnu/4.8.0/../../../../include/c++/4.8.0/type_traits:1264:12:
error: provided for 'template<class _From, class _To> struct
std::is_convertible'
functional_bug.cpp: In function 'int main()':
functional_bug.cpp:22:14: error: 'struct Types<int, int>' has no member named
'foo'


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

end of thread, other threads:[~2012-11-29 20:57 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-19  7:57 [Bug c++/53039] New: [C++11]including <functional> breaks std::is_convertible with template-pack expansion mitchnull+gcc at gmail dot com
2012-04-19  8:00 ` [Bug c++/53039] " mitchnull+gcc at gmail dot com
2012-04-19  8:00 ` mitchnull+gcc at gmail dot com
2012-04-19  8:43 ` redi at gcc dot gnu.org
2012-04-19 10:48 ` [Bug c++/53039] [4.7/4.8 Regression] including " paolo.carlini at oracle dot com
2012-04-19 14:51 ` hjl.tools at gmail dot com
2012-04-19 16:01 ` paolo.carlini at oracle dot com
2012-04-20  6:49 ` daniel.kruegler at googlemail dot com
2012-04-20  9:07 ` paolo.carlini at oracle dot com
2012-04-20 10:27 ` paolo.carlini at oracle dot com
2012-04-20 12:38 ` paolo.carlini at oracle dot com
2012-04-26 14:02 ` rguenth at gcc dot gnu.org
2012-04-26 14:23 ` rguenth at gcc dot gnu.org
2012-05-02 11:46 ` jakub at gcc dot gnu.org
2012-06-11  5:59 ` jason at gcc dot gnu.org
2012-06-14  8:47 ` rguenth at gcc dot gnu.org
2012-06-14 10:03 ` paolo.carlini at oracle dot com
2012-07-05 17:16 ` jason at gcc dot gnu.org
2012-07-05 19:39 ` jason at gcc dot gnu.org
2012-07-05 21:25 ` jason at gcc dot gnu.org
2012-07-06  1:34 ` [Bug c++/53039] [4.7 " jason at gcc dot gnu.org
2012-09-13 10:31 ` paolo.carlini at oracle dot com
2012-09-20 10:28 ` jakub at gcc dot gnu.org
2012-11-29 20:18 ` jason at gcc dot gnu.org
2012-11-29 20:57 ` jason 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).