Commit aaec81f1 by Jason Merrill Committed by Jason Merrill

PR c++/82664 - ICE with reference to function template parm.

	* pt.c (convert_nontype_argument_function): Avoid obfuscationg
	NOP_EXPRs.

From-SVN: r257753
parent dec5af9f
2018-02-16 Jason Merrill <jason@redhat.com> 2018-02-16 Jason Merrill <jason@redhat.com>
PR c++/82664 - ICE with reference to function template parm.
* pt.c (convert_nontype_argument_function): Avoid obfuscationg
NOP_EXPRs.
PR c++/82764 - C++17 ICE with empty base PR c++/82764 - C++17 ICE with empty base
* class.c (build_base_field_1): Set DECL_SIZE to zero for empty base. * class.c (build_base_field_1): Set DECL_SIZE to zero for empty base.
......
...@@ -6143,7 +6143,12 @@ convert_nontype_argument_function (tree type, tree expr, ...@@ -6143,7 +6143,12 @@ convert_nontype_argument_function (tree type, tree expr,
accept: accept:
if (TREE_CODE (type) == REFERENCE_TYPE) if (TREE_CODE (type) == REFERENCE_TYPE)
fn = build_address (fn); {
if (REFERENCE_REF_P (fn))
fn = TREE_OPERAND (fn, 0);
else
fn = build_address (fn);
}
if (!same_type_ignoring_top_level_qualifiers_p (type, TREE_TYPE (fn))) if (!same_type_ignoring_top_level_qualifiers_p (type, TREE_TYPE (fn)))
fn = build_nop (type, fn); fn = build_nop (type, fn);
......
// PR c++/82664
template < typename > struct target_disambiguator;
template < typename R, typename A1 > struct target_disambiguator< R(A1) > {
typedef A1 type;
template < R (&)() > struct layout;
};
int main() {
typedef target_disambiguator< void (int) > ::type target_type ;
}
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