[Bug c++/79790] [C++17] ICE class template argument deduction failed

2017-10-19 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79790

Paolo Carlini  changed:

   What|Removed |Added

 CC||pkeir at outlook dot com

--- Comment #11 from Paolo Carlini  ---
*** Bug 80997 has been marked as a duplicate of this bug. ***

[Bug c++/79790] [C++17] ICE class template argument deduction failed

2017-09-13 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79790

--- Comment #10 from Aldy Hernandez  ---
Author: aldyh
Date: Wed Sep 13 16:30:28 2017
New Revision: 252298

URL: https://gcc.gnu.org/viewcvs?rev=252298=gcc=rev
Log:
/cp
2017-08-04  Paolo Carlini  

PR c++/79790
* pt.c (do_class_deduction): Handle the case of no viable implicit
deduction guides; simplify the code generating implicit deduction
guides.

/testsuite
2017-08-04  Paolo Carlini  

PR c++/79790
* g++.dg/cpp1z/class-deduction42.C: New.

Added:
branches/range-gen2/gcc/testsuite/g++.dg/cpp1z/class-deduction43.C
Modified:
branches/range-gen2/gcc/testsuite/ChangeLog

[Bug c++/79790] [C++17] ICE class template argument deduction failed

2017-09-13 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79790

--- Comment #9 from Aldy Hernandez  ---
Author: aldyh
Date: Wed Sep 13 16:30:01 2017
New Revision: 252297

URL: https://gcc.gnu.org/viewcvs?rev=252297=gcc=rev
Log:
/cp
2017-08-04  Paolo Carlini  

PR c++/79790
* pt.c (do_class_deduction): Handle the case of no viable implicit
deduction guides; simplify the code generating implicit deduction
guides.

/testsuite
2017-08-04  Paolo Carlini  

PR c++/79790
* g++.dg/cpp1z/class-deduction42.C: New.

Modified:
branches/range-gen2/gcc/cp/ChangeLog
branches/range-gen2/gcc/cp/pt.c
branches/range-gen2/gcc/testsuite/ChangeLog

[Bug c++/79790] [C++17] ICE class template argument deduction failed

2017-08-04 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79790

Paolo Carlini  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Assignee|paolo.carlini at oracle dot com|unassigned at gcc dot 
gnu.org
   Target Milestone|--- |8.0

--- Comment #8 from Paolo Carlini  ---
Fixed. Note: new testcase in g++.dg/cpp1z/class-deduction43.C, sorry about the
split commit.

[Bug c++/79790] [C++17] ICE class template argument deduction failed

2017-08-04 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79790

--- Comment #7 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Fri Aug  4 22:15:48 2017
New Revision: 250883

URL: https://gcc.gnu.org/viewcvs?rev=250883=gcc=rev
Log:
/cp
2017-08-04  Paolo Carlini  

PR c++/79790
* pt.c (do_class_deduction): Handle the case of no viable implicit
deduction guides; simplify the code generating implicit deduction
guides.

/testsuite
2017-08-04  Paolo Carlini  

PR c++/79790
* g++.dg/cpp1z/class-deduction42.C: New.

Added:
trunk/gcc/testsuite/g++.dg/cpp1z/class-deduction43.C
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug c++/79790] [C++17] ICE class template argument deduction failed

2017-08-04 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79790

--- Comment #6 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Fri Aug  4 22:13:46 2017
New Revision: 250882

URL: https://gcc.gnu.org/viewcvs?rev=250882=gcc=rev
Log:
/cp
2017-08-04  Paolo Carlini  

PR c++/79790
* pt.c (do_class_deduction): Handle the case of no viable implicit
deduction guides; simplify the code generating implicit deduction
guides.

/testsuite
2017-08-04  Paolo Carlini  

PR c++/79790
* g++.dg/cpp1z/class-deduction42.C: New.

Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/79790] [C++17] ICE class template argument deduction failed

2017-07-13 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79790

Paolo Carlini  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |paolo.carlini at oracle 
dot com

--- Comment #5 from Paolo Carlini  ---
Looking into it.

[Bug c++/79790] [C++17] ICE class template argument deduction failed

2017-03-15 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79790

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-03-16
 CC||msebor at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #4 from Martin Sebor  ---
Oddly, I'm not able to reproduce the ICE with the test case with today's top of
trunk or any recent revisions (February through March 2017).  They all issue
the error below and exit:

t.C:4:29: error: cannot deduce template arguments for ‘std::array<_Tp, _Nm>’,
as it has no deduction guides or user-declared constructors
   constexpr const int& operator[](int i) const { return a[i]; }
 ^

But the following test case does reproduce it:

$ cat t.C && gcc -Wall -Wextra -Wpedantic -std=c++1z t.C
template 
struct array
{
  int a [N];
};

array a = { 1, 2, 3 };
t.C:7:21: error: class template argument deduction failed:
 array a = { 1, 2, 3 };
 ^
t.C:7:21: internal compiler error: Segmentation fault
0x1174c74 crash_signal
/src/gcc/svn/gcc/toplev.c:337
0x7b8893 print_error_for_call_failure
/src/gcc/svn/gcc/cp/call.c:4170
0x7b8ab9 build_new_function_call(tree_node*, vec**, bool, int)
/src/gcc/svn/gcc/cp/call.c:4224
0x8a5474 do_class_deduction
/src/gcc/svn/gcc/cp/pt.c:25270
0x8a562b do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
/src/gcc/svn/gcc/cp/pt.c:25322
0x7f5d61 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
/src/gcc/svn/gcc/cp/decl.c:6835
0x9419c3 cp_parser_init_declarator
/src/gcc/svn/gcc/cp/parser.c:19384
0x935b04 cp_parser_simple_declaration
/src/gcc/svn/gcc/cp/parser.c:12781
0x93567c cp_parser_block_declaration
/src/gcc/svn/gcc/cp/parser.c:12599
0x9353fe cp_parser_declaration
/src/gcc/svn/gcc/cp/parser.c:12496
0x934f5d cp_parser_declaration_seq_opt
/src/gcc/svn/gcc/cp/parser.c:12372
0x923dc1 cp_parser_translation_unit
/src/gcc/svn/gcc/cp/parser.c:4366
0x9742a4 c_parse_file()
/src/gcc/svn/gcc/cp/parser.c:38423
0xb27abd c_common_parse_file()
/src/gcc/svn/gcc/c-family/c-opts.c:1107
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/79790] [C++17] ICE class template argument deduction failed

2017-03-01 Thread jochen.goert...@uni-konstanz.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79790

--- Comment #3 from Jochen Görtler  ---
This is the error:

template_class_deduction.cpp: In function ‘int main()’:
template_class_deduction.cpp:4:29: error: class template argument deduction
failed:
 std::array test = {1,2,3};
 ^
template_class_deduction.cpp:4:29: internal compiler error: Segmentation fault
0xd6c37f crash_signal
../../gcc-bug/gcc/toplev.c:337
0x61021e print_error_for_call_failure
../../gcc-bug/gcc/cp/call.c:4170
0x610e3a build_new_function_call(tree_node*, vec**, bool, int)
../../gcc-bug/gcc/cp/call.c:4224
0x68be54 do_class_deduction
../../gcc-bug/gcc/cp/pt.c:25217
0x68be54 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
../../gcc-bug/gcc/cp/pt.c:25270
0x648972 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc-bug/gcc/cp/decl.c:6835
0x727c53 cp_parser_init_declarator
../../gcc-bug/gcc/cp/parser.c:19375
0x74bd0c cp_parser_simple_declaration
../../gcc-bug/gcc/cp/parser.c:12772
0x74cab5 cp_parser_block_declaration
../../gcc-bug/gcc/cp/parser.c:12597
0x74d569 cp_parser_declaration_statement
../../gcc-bug/gcc/cp/parser.c:12207
0x725893 cp_parser_statement
../../gcc-bug/gcc/cp/parser.c:10694
0x72692d cp_parser_statement_seq_opt
../../gcc-bug/gcc/cp/parser.c:11026
0x7269ff cp_parser_compound_statement
../../gcc-bug/gcc/cp/parser.c:10980
0x726b93 cp_parser_function_body
../../gcc-bug/gcc/cp/parser.c:21427
0x726b93 cp_parser_ctor_initializer_opt_and_function_body
../../gcc-bug/gcc/cp/parser.c:21465
0x727411 cp_parser_function_definition_after_declarator
../../gcc-bug/gcc/cp/parser.c:26252
0x7280fd cp_parser_function_definition_from_specifiers_and_declarator
../../gcc-bug/gcc/cp/parser.c:26164
0x7280fd cp_parser_init_declarator
../../gcc-bug/gcc/cp/parser.c:19154
0x74bd0c cp_parser_simple_declaration
../../gcc-bug/gcc/cp/parser.c:12772
0x74cab5 cp_parser_block_declaration
../../gcc-bug/gcc/cp/parser.c:12597
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/79790] [C++17] ICE class template argument deduction failed

2017-03-01 Thread jochen.goert...@uni-konstanz.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79790

--- Comment #2 from Jochen Görtler  ---
The bug can also be reproduced in the compiler explorer:
https://godbolt.org/g/3NBvoL

[Bug c++/79790] [C++17] ICE class template argument deduction failed

2017-03-01 Thread jochen.goert...@uni-konstanz.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79790

--- Comment #1 from Jochen Görtler  ---
Using built-in specs.
COLLECT_GCC=../gcc-bug/bin/g++
COLLECT_LTO_WRAPPER=/home/jochen/Developer/gcc-bug/libexec/gcc/x86_64-pc-linux-gnu/7.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-bug/configure --prefix=/home/jochen/Developer/gcc-bug
--enable-languages=c,c++ --disable-multilib
Thread model: posix
gcc version 7.0.1 20170301 (experimental) (GCC)