re PR c++/85065 ([concepts] ICE with invalid use of a concept)
/cp 2018-09-18 Paolo Carlini <paolo.carlini@oracle.com> PR c++/85065 * cp-tree.h (NON_ERROR): New. * pt.c (auto_hash::hash): Use it. (do_auto_deduction): Likewise. /testsuite 2018-09-18 Paolo Carlini <paolo.carlini@oracle.com> PR c++/85065 * g++.dg/concepts/pr85065.C: New. From-SVN: r264402
This commit is contained in:
parent
b7663a763f
commit
c99fcadae8
@ -1,3 +1,10 @@
|
||||
2018-09-18 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/85065
|
||||
* cp-tree.h (NON_ERROR): New.
|
||||
* pt.c (auto_hash::hash): Use it.
|
||||
(do_auto_deduction): Likewise.
|
||||
|
||||
2018-09-18 Nathan Sidwell <nathan@acm.org>
|
||||
|
||||
PR c++/86881
|
||||
|
@ -1877,6 +1877,8 @@ struct GTY(()) language_function {
|
||||
/* In parser.c. */
|
||||
extern tree cp_literal_operator_id (const char *);
|
||||
|
||||
#define NON_ERROR(NODE) ((NODE) == error_mark_node ? NULL_TREE : (NODE))
|
||||
|
||||
/* TRUE if a tree code represents a statement. */
|
||||
extern bool statement_code_p[MAX_TREE_CODES];
|
||||
|
||||
|
@ -26121,7 +26121,7 @@ struct auto_hash : default_hash_traits<tree>
|
||||
inline hashval_t
|
||||
auto_hash::hash (tree t)
|
||||
{
|
||||
if (tree c = PLACEHOLDER_TYPE_CONSTRAINTS (t))
|
||||
if (tree c = NON_ERROR (PLACEHOLDER_TYPE_CONSTRAINTS (t)))
|
||||
/* Matching constrained-type-specifiers denote the same template
|
||||
parameter, so hash the constraint. */
|
||||
return hash_placeholder_constraint (c);
|
||||
@ -26880,7 +26880,7 @@ do_auto_deduction (tree type, tree init, tree auto_node,
|
||||
|
||||
/* Check any placeholder constraints against the deduced type. */
|
||||
if (flag_concepts && !processing_template_decl)
|
||||
if (tree constr = PLACEHOLDER_TYPE_CONSTRAINTS (auto_node))
|
||||
if (tree constr = NON_ERROR (PLACEHOLDER_TYPE_CONSTRAINTS (auto_node)))
|
||||
{
|
||||
/* Use the deduced type to check the associated constraints. If we
|
||||
have a partial-concept-id, rebuild the argument list so that
|
||||
|
@ -1,3 +1,8 @@
|
||||
2018-09-18 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/85065
|
||||
* g++.dg/concepts/pr85065.C: New.
|
||||
|
||||
2018-09-18 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
||||
|
||||
PR testsuite/87339
|
||||
@ -11,10 +16,10 @@
|
||||
|
||||
2018-09-18 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
||||
|
||||
* gcc.target/aarch64/spellcheck_1.c:
|
||||
Make architecture suggestion optional.
|
||||
* gcc.target/aarch64/spellcheck_4.c:
|
||||
Likewise.
|
||||
* gcc.target/aarch64/spellcheck_1.c:
|
||||
Make architecture suggestion optional.
|
||||
* gcc.target/aarch64/spellcheck_4.c:
|
||||
Likewise.
|
||||
|
||||
2018-09-18 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
||||
|
||||
|
6
gcc/testsuite/g++.dg/concepts/pr85065.C
Normal file
6
gcc/testsuite/g++.dg/concepts/pr85065.C
Normal file
@ -0,0 +1,6 @@
|
||||
// { dg-do compile { target c++14 } }
|
||||
// { dg-additional-options "-fconcepts" }
|
||||
|
||||
template<int> concept bool C = true;
|
||||
|
||||
C c = 0; // { dg-error "invalid reference to concept" }
|
Loading…
Reference in New Issue
Block a user