mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/84644 (internal compiler error: in warn_misplaced_attr_for_class_type, at cp/decl.c:4718)
/cp 2018-12-15 Paolo Carlini <paolo.carlini@oracle.com> PR c++/84644 * decl.c (check_tag_decl): A decltype with no declarator doesn't declare anything. /testsuite 2018-12-15 Paolo Carlini <paolo.carlini@oracle.com> PR c++/84644 * g++.dg/cpp0x/decltype68.C: New. * g++.dg/cpp0x/decltype-33838.C: Adjust. * g++.dg/template/spec32.C: Likewise. * g++.dg/template/ttp22.C: Likewise. From-SVN: r267165
This commit is contained in:
parent
590f447b70
commit
1039d00c59
|
|
@ -1,3 +1,9 @@
|
|||
2018-12-15 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/84644
|
||||
* decl.c (check_tag_decl): A decltype with no declarator
|
||||
doesn't declare anything.
|
||||
|
||||
2018-12-14 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
PR c++/87814
|
||||
|
|
|
|||
|
|
@ -4803,15 +4803,20 @@ check_tag_decl (cp_decl_specifier_seq *declspecs,
|
|||
declared_type = declspecs->type;
|
||||
else if (declspecs->type == error_mark_node)
|
||||
error_p = true;
|
||||
if (declared_type == NULL_TREE && ! saw_friend && !error_p)
|
||||
permerror (input_location, "declaration does not declare anything");
|
||||
else if (declared_type != NULL_TREE && type_uses_auto (declared_type))
|
||||
|
||||
if (type_uses_auto (declared_type))
|
||||
{
|
||||
error_at (declspecs->locations[ds_type_spec],
|
||||
"%<auto%> can only be specified for variables "
|
||||
"or function declarations");
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
if (declared_type && !OVERLOAD_TYPE_P (declared_type))
|
||||
declared_type = NULL_TREE;
|
||||
|
||||
if (!declared_type && !saw_friend && !error_p)
|
||||
permerror (input_location, "declaration does not declare anything");
|
||||
/* Check for an anonymous union. */
|
||||
else if (declared_type && RECORD_OR_UNION_CODE_P (TREE_CODE (declared_type))
|
||||
&& TYPE_UNNAMED_P (declared_type))
|
||||
|
|
|
|||
|
|
@ -1,3 +1,11 @@
|
|||
2018-12-15 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/84644
|
||||
* g++.dg/cpp0x/decltype68.C: New.
|
||||
* g++.dg/cpp0x/decltype-33838.C: Adjust.
|
||||
* g++.dg/template/spec32.C: Likewise.
|
||||
* g++.dg/template/ttp22.C: Likewise.
|
||||
|
||||
2018-12-15 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR target/88489
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@
|
|||
// PR c++/33838
|
||||
template<typename T> struct A
|
||||
{
|
||||
__decltype (T* foo()); // { dg-error "expected|no arguments|accept" }
|
||||
__decltype (T* foo()); // { dg-error "expected|no arguments|declaration" }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
// PR c++/84644
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
template<int a>
|
||||
struct b {
|
||||
decltype(a) __attribute__((break)); // { dg-error "declaration does not declare anything" }
|
||||
};
|
||||
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
struct A
|
||||
{
|
||||
template<template<int> class B> struct B<0>; // { dg-error "name of class shadows" }
|
||||
template<template<int> class B> struct B<0>; // { dg-error "declaration does not declare anything" }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// { dg-do compile }
|
||||
|
||||
template<template<int> class A>
|
||||
class A<0>; // { dg-error "shadows template template parameter" }
|
||||
class A<0>; // { dg-error "declaration does not declare anything" }
|
||||
|
||||
template<template<int> class B>
|
||||
class B<0> {}; // { dg-error "shadows template template parameter" }
|
||||
|
|
|
|||
Loading…
Reference in New Issue