mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-13 17:11:23 +08:00
PR c++/88325 - ICE with invalid out-of-line template member definition.
* parser.c (cp_parser_class_name): Don't call make_typename_type for overloads. * g++.dg/cpp2a/typename14.C: New test. From-SVN: r268455
This commit is contained in:
parent
e71ac16355
commit
a53a893b4f
@ -1,3 +1,9 @@
|
||||
2019-02-01 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/88325 - ICE with invalid out-of-line template member definition.
|
||||
* parser.c (cp_parser_class_name): Don't call make_typename_type
|
||||
for overloads.
|
||||
|
||||
2019-02-01 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/87175
|
||||
|
@ -23167,7 +23167,9 @@ cp_parser_class_name (cp_parser *parser,
|
||||
decl = cp_parser_maybe_treat_template_as_class (decl, class_head_p);
|
||||
|
||||
/* If this is a typename, create a TYPENAME_TYPE. */
|
||||
if (typename_p && decl != error_mark_node)
|
||||
if (typename_p
|
||||
&& decl != error_mark_node
|
||||
&& !is_overloaded_fn (decl))
|
||||
{
|
||||
decl = make_typename_type (scope, decl, typename_type,
|
||||
/*complain=*/tf_error);
|
||||
|
@ -1,3 +1,8 @@
|
||||
2019-02-01 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/88325 - ICE with invalid out-of-line template member definition.
|
||||
* g++.dg/cpp2a/typename14.C: New test.
|
||||
|
||||
2019-02-01 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/88597
|
||||
|
25
gcc/testsuite/g++.dg/cpp2a/typename14.C
Normal file
25
gcc/testsuite/g++.dg/cpp2a/typename14.C
Normal file
@ -0,0 +1,25 @@
|
||||
// PR c++/88325
|
||||
// { dg-do compile { target c++2a } }
|
||||
|
||||
template<typename> struct A
|
||||
{
|
||||
template<typename> A ();
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
template<typename U>
|
||||
A<T>::A<U> () // { dg-error "partial specialization" }
|
||||
{
|
||||
}
|
||||
|
||||
template<typename> struct B
|
||||
{
|
||||
template<typename> int foo (int);
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
template<typename U>
|
||||
B<T>::foo<int>(int) // { dg-error "partial specialization|declaration" }
|
||||
{
|
||||
return 1;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user