[Bug c++/95319] [10/11 Regression] Regression from gcc9.3 when inserting into a vector with an initializer list. Error: a GNU-style designated initializer for class

2020-05-27 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95319

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Jason Merrill  ---
Fixed for 10.2/11.

[Bug c++/95319] [10/11 Regression] Regression from gcc9.3 when inserting into a vector with an initializer list. Error: a GNU-style designated initializer for class

2020-05-27 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95319

--- Comment #3 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Jason Merrill
:

https://gcc.gnu.org/g:a6deb68d01316055072b8856185da4eaf77836d1

commit r10-8192-ga6deb68d01316055072b8856185da4eaf77836d1
Author: Jason Merrill 
Date:   Wed May 27 10:27:25 2020 -0400

c++: Handle multiple aggregate overloads [PR95319].

Here, when considering the two 'insert' overloads, we look for aggregate
conversions from the same initializer-list to B<3> or
initializer_list>.  But since my fix for reshape_init overhead on the
PR14179 testcase we reshaped the initializer-list directly, leading to an
error when we then tried to reshape it differently for the second overload.

gcc/cp/ChangeLog:

PR c++/95319
* decl.c (reshape_init_array_1): Don't reuse in overload context.

gcc/testsuite/ChangeLog:

PR c++/95319
* g++.dg/cpp0x/initlist-array12.C: New test.

(cherry picked from commit 6efa97ea1d2fe6df1fbb9df78faaa2248a8618d7)

[Bug c++/95319] [10/11 Regression] Regression from gcc9.3 when inserting into a vector with an initializer list. Error: a GNU-style designated initializer for class

2020-05-27 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95319

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:6efa97ea1d2fe6df1fbb9df78faaa2248a8618d7

commit r11-666-g6efa97ea1d2fe6df1fbb9df78faaa2248a8618d7
Author: Jason Merrill 
Date:   Wed May 27 10:27:25 2020 -0400

c++: Handle multiple aggregate overloads [PR95319].

Here, when considering the two 'insert' overloads, we look for aggregate
conversions from the same initializer-list to B<3> or
initializer_list>.  But since my fix for reshape_init overhead on the
PR14179 testcase we reshaped the initializer-list directly, leading to an
error when we then tried to reshape it differently for the second overload.

gcc/cp/ChangeLog:

PR c++/95319
* decl.c (reshape_init_array_1): Don't reuse in overload context.

gcc/testsuite/ChangeLog:

PR c++/95319
* g++.dg/cpp0x/initlist-array12.C: New test.

[Bug c++/95319] [10/11 Regression] Regression from gcc9.3 when inserting into a vector with an initializer list. Error: a GNU-style designated initializer for class

2020-05-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95319

Jason Merrill  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org
 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1
   Last reconfirmed||2020-05-26

[Bug c++/95319] [10/11 Regression] Regression from gcc9.3 when inserting into a vector with an initializer list. Error: a GNU-style designated initializer for class

2020-05-26 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95319

Martin Liška  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org

--- Comment #1 from Martin Liška  ---
Confirmed, started with r10-6388-ge98ebda074bf8fc5.

Reduced test-case:

$ cat pr95319.ii
namespace std {
template  class initializer_list {
  int *_M_array;
  unsigned long _M_len;
};
template  struct A { typedef int _Type[_Nm]; };
template  struct B { typename A<_Nm>::_Type _M_elems; };
class C {
public:
  void insert(int, B<3>);
  void insert(int, initializer_list>);
};
} // namespace std
int a;
int
main() {
  using ArrayVector = std::C;
  auto b = ArrayVector();
  b.insert(a, {{2}});
  return 0;
}

[Bug c++/95319] [10/11 Regression] Regression from gcc9.3 when inserting into a vector with an initializer list. Error: a GNU-style designated initializer for class

2020-05-26 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95319

Richard Biener  changed:

   What|Removed |Added

   Keywords||rejects-valid
  Known to fail||10.1.0
Summary|Regression from gcc9.3 when |[10/11 Regression]
   |inserting into a vector |Regression from gcc9.3 when
   |with an initializer list.   |inserting into a vector
   |Error: a GNU-style  |with an initializer list.
   |designated initializer for  |Error: a GNU-style
   |class   |designated initializer for
   ||class
   Target Milestone|--- |10.2
  Known to work||9.3.0