public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48451] New: [C++0x][SFINAE] Failures with n-ary initialization expressions (with template default argument)
@ 2011-04-05  6:49 daniel.kruegler at googlemail dot com
  2011-04-08  2:03 ` [Bug c++/48451] " jason at gcc dot gnu.org
  2011-04-08 15:13 ` jason at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2011-04-05  6:49 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [C++0x][SFINAE] Failures with n-ary initialization
                    expressions (with template default argument)
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: daniel.kruegler@googlemail.com
                CC: jason@redhat.com


Some n-ary initialization expressions in a SFINAE context used in function
template default arguments either give a hard error:

  a) any T => abstract class

or give the wrong result:

  b) when the destination is a class type constructed from valid arguments

#include <utility> // for declval

template<class T, class... Args,
 class = decltype(T(std::declval<Args>()...))
>
char f(int);

template<class, class...>
char (&f(...))[2];

struct A { virtual ~A() = 0; };
struct From2Ints { From2Ints(int, int); };

static_assert(sizeof(f<A, int, int>(0)) != 1, "Error"); // a
static_assert(sizeof(f<From2Ints, int, int>(0)) == 1, "Error"); // b

a) "error: cannot allocate an object of abstract type 'A' because the
following virtual functions are pure within 'A': virtual A::~A()"
b) Assertion triggers!


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

* [Bug c++/48451] [C++0x][SFINAE] Failures with n-ary initialization expressions (with template default argument)
  2011-04-05  6:49 [Bug c++/48451] New: [C++0x][SFINAE] Failures with n-ary initialization expressions (with template default argument) daniel.kruegler at googlemail dot com
@ 2011-04-08  2:03 ` jason at gcc dot gnu.org
  2011-04-08 15:13 ` jason at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu.org @ 2011-04-08  2:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> 2011-04-08 02:03:29 UTC ---
Author: jason
Date: Fri Apr  8 02:03:25 2011
New Revision: 172159

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172159
Log:
    PR c++/48451
    * pt.c (fn_type_unification): Don't clear incomplete pack flag.
    (type_unification_real): Clear it here instead.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic107.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/48451] [C++0x][SFINAE] Failures with n-ary initialization expressions (with template default argument)
  2011-04-05  6:49 [Bug c++/48451] New: [C++0x][SFINAE] Failures with n-ary initialization expressions (with template default argument) daniel.kruegler at googlemail dot com
  2011-04-08  2:03 ` [Bug c++/48451] " jason at gcc dot gnu.org
@ 2011-04-08 15:13 ` jason at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu.org @ 2011-04-08 15:13 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jason at gcc dot gnu.org
         Resolution|                            |FIXED
   Target Milestone|---                         |4.7.0

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-04-08 15:13:13 UTC ---
Fixed.


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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-05  6:49 [Bug c++/48451] New: [C++0x][SFINAE] Failures with n-ary initialization expressions (with template default argument) daniel.kruegler at googlemail dot com
2011-04-08  2:03 ` [Bug c++/48451] " jason at gcc dot gnu.org
2011-04-08 15:13 ` 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).