public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48737] New: [C++0x][SFINAE] Hard errors with array list-construction with too many elements
@ 2011-04-22 21:38 daniel.kruegler at googlemail dot com
  2011-05-08 15:23 ` [Bug c++/48737] " paolo.carlini at oracle dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2011-04-22 21:38 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [C++0x][SFINAE] Hard errors with array
                    list-construction with too many elements
           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


gcc 4.7.0 20110422 (experimental) in C++0x mode rejects the following code:

//-------------------------
template<class T>
T&& create();

template<class T, class... Args>
decltype(T{create<Args>()...}, char()) f(int);

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

static_assert(sizeof(f<int[1], int, int>(0)) != 1, "Error");
//-------------------------

"error: too many initializers for ‘int [1]’"

The code should be accepted.


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

* [Bug c++/48737] [C++0x][SFINAE] Hard errors with array list-construction with too many elements
  2011-04-22 21:38 [Bug c++/48737] New: [C++0x][SFINAE] Hard errors with array list-construction with too many elements daniel.kruegler at googlemail dot com
@ 2011-05-08 15:23 ` paolo.carlini at oracle dot com
  2011-05-08 15:29 ` paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-05-08 15:23 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011.05.08 15:16:39
         AssignedTo|unassigned at gcc dot       |paolo.carlini at oracle dot
                   |gnu.org                     |com
     Ever Confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-08 15:16:39 UTC ---
On it.


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

* [Bug c++/48737] [C++0x][SFINAE] Hard errors with array list-construction with too many elements
  2011-04-22 21:38 [Bug c++/48737] New: [C++0x][SFINAE] Hard errors with array list-construction with too many elements daniel.kruegler at googlemail dot com
  2011-05-08 15:23 ` [Bug c++/48737] " paolo.carlini at oracle dot com
@ 2011-05-08 15:29 ` paolo.carlini at oracle dot com
  2011-05-08 15:47 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-05-08 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
         AssignedTo|paolo.carlini at oracle dot |unassigned at gcc dot
                   |com                         |gnu.org
   Target Milestone|---                         |4.7.0

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-08 15:18:00 UTC ---
Nope. sorry.


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

* [Bug c++/48737] [C++0x][SFINAE] Hard errors with array list-construction with too many elements
  2011-04-22 21:38 [Bug c++/48737] New: [C++0x][SFINAE] Hard errors with array list-construction with too many elements daniel.kruegler at googlemail dot com
  2011-05-08 15:23 ` [Bug c++/48737] " paolo.carlini at oracle dot com
  2011-05-08 15:29 ` paolo.carlini at oracle dot com
@ 2011-05-08 15:47 ` paolo.carlini at oracle dot com
  2011-05-09 19:29 ` paolo at gcc dot gnu.org
  2011-05-09 19:46 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-05-08 15:47 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot       |paolo.carlini at oracle dot
                   |gnu.org                     |com

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-08 15:44:32 UTC ---
Actually, working on this one too.


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

* [Bug c++/48737] [C++0x][SFINAE] Hard errors with array list-construction with too many elements
  2011-04-22 21:38 [Bug c++/48737] New: [C++0x][SFINAE] Hard errors with array list-construction with too many elements daniel.kruegler at googlemail dot com
                   ` (2 preceding siblings ...)
  2011-05-08 15:47 ` paolo.carlini at oracle dot com
@ 2011-05-09 19:29 ` paolo at gcc dot gnu.org
  2011-05-09 19:46 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo at gcc dot gnu.org @ 2011-05-09 19:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2011-05-09 19:24:53 UTC ---
Author: paolo
Date: Mon May  9 19:24:50 2011
New Revision: 173590

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173590
Log:
/cp
2011-05-09  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/48737
    PR c++/48744
    * decl.c (reshape_init): Take a complain parameter and do
    not call error if tf_error is not set.
    (check_initializer, reshape_init_r, reshape_init_array,
    reshape_init_array_1, reshape_init_vector, reshape_init_class):
    Adjust.
    * typeck2.c (digest_init_r): Take a complain parameter and
    pass it to convert_for_initialization.
    (digest_init, digest_init_flags, process_init_constructor_array,
    process_init_constructor_record, process_init_constructor_union,
    process_init_constructor, digest_init_r): Adjust.
    * init.c (expand_default_init, build_new_1): Likewise.
    * typeck.c (cp_build_modify_expr): Likewise.
    * decl2.c (grokfield): Likewise.
    * call.c (convert_like_real, convert_default_arg): Likewise.
    * semantics.c (finish_compound_literal): Pass complain to
    reshape_init and digest_init.
    * cp-tree.h: Adjust declarations.

/testsuite
2011-05-09  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/48737
    PR c++/48744
    * g++.dg/template/sfinae28.C: New.
    * g++.dg/template/sfinae29.C: Likewise.

Added:
    trunk/gcc/testsuite/g++.dg/template/sfinae28.C
    trunk/gcc/testsuite/g++.dg/template/sfinae29.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/decl2.c
    trunk/gcc/cp/init.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/cp/typeck2.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/48737] [C++0x][SFINAE] Hard errors with array list-construction with too many elements
  2011-04-22 21:38 [Bug c++/48737] New: [C++0x][SFINAE] Hard errors with array list-construction with too many elements daniel.kruegler at googlemail dot com
                   ` (3 preceding siblings ...)
  2011-05-09 19:29 ` paolo at gcc dot gnu.org
@ 2011-05-09 19:46 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-05-09 19:46 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

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

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-09 19:26:47 UTC ---
Done.


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

end of thread, other threads:[~2011-05-09 19:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-22 21:38 [Bug c++/48737] New: [C++0x][SFINAE] Hard errors with array list-construction with too many elements daniel.kruegler at googlemail dot com
2011-05-08 15:23 ` [Bug c++/48737] " paolo.carlini at oracle dot com
2011-05-08 15:29 ` paolo.carlini at oracle dot com
2011-05-08 15:47 ` paolo.carlini at oracle dot com
2011-05-09 19:29 ` paolo at gcc dot gnu.org
2011-05-09 19:46 ` paolo.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).