[Bug c++/66564] ICE on explicit instantiation of nested template class

2021-12-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66564

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||accepts-invalid

--- Comment #5 from Andrew Pinski  ---
Reduced testcase:

  template
  struct A {
   template
   struct B {};
  };

template<>
  template
  struct A::B {};

  int main() {
   A::B b;
  }

Without the definition of b in main, we accept the invalid code.

[Bug c++/66564] ICE on explicit instantiation of nested template class

2021-12-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66564

Andrew Pinski  changed:

   What|Removed |Added

 CC||matthewjbarichello at gmail 
dot co
   ||m

--- Comment #4 from Andrew Pinski  ---
*** Bug 103667 has been marked as a duplicate of this bug. ***

[Bug c++/66564] ICE on explicit instantiation of nested template class

2019-06-08 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66564

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #3 from Marek Polacek  ---
Still ICEs with gcc version 10.0.0 20190608 (experimental) (GCC)

[Bug c++/66564] ICE on explicit instantiation of nested template class

2018-03-02 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66564

Paolo Carlini  changed:

   What|Removed |Added

 CC||benni.buch at gmail dot com

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

[Bug c++/66564] ICE on explicit instantiation of nested template class

2016-07-31 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66564

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||trippels at gcc dot gnu.org

--- Comment #1 from Markus Trippelsdorf  ---
Confirmed. All version are affected:

markus@x4 tmp % clang++ -std=c++14 -c foo2.ii
foo2.ii:2:1: error: too few template parameters in template redeclaration
template <> template  class Outer<_T_>::Inner<_T_> {};
^~~
foo2.ii:1:1: note: previous template declaration is here
template  struct Outer { template  struct Inner; };
^~~
foo2.ii:3:29: error: explicit instantiation of undefined template
'Outer::Inner'
template struct Outer::Inner;
^
foo2.ii:1:63: note: template is declared here
template  struct Outer { template  struct Inner; };
  ^
2 errors generated.
markus@x4 tmp % icpc -std=c++14 -c foo2.ii
foo2.ii(2): error: nontype "Outer<>::Inner [with =_T_]" is
not a template
  template <> template  class Outer<_T_>::Inner<_T_> {};
^

foo2.ii(2): error: this declaration cannot have multiple "template <...>"
clauses
  template <> template  class Outer<_T_>::Inner<_T_> {};
^

foo2.ii(3): error: incomplete type is not allowed
  template struct Outer::Inner;
   ^

compilation aborted for foo2.ii (code 2)

markus@x4 tmp % g++ -std=c++14 -c foo2.ii
foo2.ii:2:55: internal compiler error: in retrieve_specialization, at
cp/pt.c:1183
 template <> template  class Outer<_T_>::Inner<_T_> {};
   ^~
0x6a2e8f retrieve_specialization
../../gcc/gcc/cp/pt.c:1180
0x6c12d4 tsubst_decl
../../gcc/gcc/cp/pt.c:11689
0x6b8f07 tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/gcc/cp/pt.c:12897
0x6d0fdc most_specialized_partial_spec
../../gcc/gcc/cp/pt.c:21075
0x6e94e0 instantiate_class_template_1
../../gcc/gcc/cp/pt.c:9847
0x6e94e0 instantiate_class_template(tree_node*)
../../gcc/gcc/cp/pt.c:10412
0x78c33b complete_type(tree_node*)
../../gcc/gcc/cp/typeck.c:133
0x6edeae do_type_instantiation(tree_node*, tree_node*, int)
../../gcc/gcc/cp/pt.c:21352
0x772329 cp_parser_explicit_instantiation
../../gcc/gcc/cp/parser.c:15662
0x782d11 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12132
0x7815a6 cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12059
0x7818c8 cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4350
0x7818c8 c_parse_file()
../../gcc/gcc/cp/parser.c:37581
0x8e4772 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1070

[Bug c++/66564] ICE on explicit instantiation of nested template class

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

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-08-04
 Ever confirmed|0   |1