Commit e82f9ef7 by Martin Sebor Committed by Martin Sebor

PR c++/67876 - [6 Regression] ICE when compiling Firefox 38

gcc/cp
	* pt.c (convert_template_argument): Make sure number of tree
	operands is greater than zero before attempting to extract one.

gcc/testsuite/
	* g++.dg/pr67876.C: New test.

From-SVN: r230924
parent ae026741
2015-11-25 Martin Sebor <msebor@redhat.com>
PR c++/67876
* pt.c (convert_template_argument): Make sure number of tree
operands is greater than zero before attempting to extract one.
2015-11-25 Ryan Burn <contact@rnburn.com> 2015-11-25 Ryan Burn <contact@rnburn.com>
PR c++/68434 PR c++/68434
......
...@@ -7234,6 +7234,7 @@ convert_template_argument (tree parm, ...@@ -7234,6 +7234,7 @@ convert_template_argument (tree parm,
if (TREE_CODE (TREE_TYPE (inner)) == REFERENCE_TYPE if (TREE_CODE (TREE_TYPE (inner)) == REFERENCE_TYPE
&& TREE_CODE (TREE_TYPE (TREE_TYPE (inner))) == FUNCTION_TYPE && TREE_CODE (TREE_TYPE (TREE_TYPE (inner))) == FUNCTION_TYPE
&& TREE_CODE (TREE_TYPE (inner)) == REFERENCE_TYPE && TREE_CODE (TREE_TYPE (inner)) == REFERENCE_TYPE
&& 0 < TREE_OPERAND_LENGTH (inner)
&& reject_gcc_builtin (TREE_OPERAND (inner, 0))) && reject_gcc_builtin (TREE_OPERAND (inner, 0)))
return error_mark_node; return error_mark_node;
} }
......
2015-11-25 Martin Sebor <msebor@redhat.com>
PR c++/67876
* g++.dg/pr67876.C: New test.
2015-11-25 Aditya Kumar <aditya.k7@samsung.com> 2015-11-25 Aditya Kumar <aditya.k7@samsung.com>
Sebastian Pop <s.pop@samsung.com> Sebastian Pop <s.pop@samsung.com>
......
// PR c++/67876 - [6 Regression] ICE when compiling Firefox 38
// Caused by a patch for c/66516 - missing diagnostic on taking
// the address of a builtin function
// { dg-do compile }
template <class T, void (&F)(T*)>
struct S { };
extern void foo (int*);
template <class T, void (&F)(T*)>
void bar (S<T, F>&s) { }
S<int, foo> s;
void foobar (S<int, foo> &s) { bar (s); }
// PR c++/67876 - [6 Regression] ICE when compiling Firefox 38
// Caused by a patch for c/66516 - missing diagnostic on taking
// the address of a builtin function
// { dg-do compile }
template <class T, void (&F)(T*)>
struct S { };
extern void foo (int*);
template <class T, void (&F)(T*)>
void bar (S<T, F>&s) { }
S<int, foo> s;
void foobar (S<int, foo> &s) { bar (s); }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment