Skip to content
Snippets Groups Projects
Commit c3bc2787 authored by Jason Merrill's avatar Jason Merrill
Browse files

c++: const void* memchr [PR113706]

The C++ standard specifies that the <string.h> functions have const and
non-const overloads, unlike C's single function with const argument and
non-const return.  Many systems don't actually implement this, but only add
an overload with non-const argument, so both end up having non-const return.
Solaris <string.h> does what the standard says, but we were penalizing it by
not recognizing the const overload as the built-in memchr.

	PR c++/113706

gcc/cp/ChangeLog:

	* decl.cc (decls_match): Handle memchr return type being
	const-qualified.

gcc/testsuite/ChangeLog:

	* g++.dg/opt/const-builtin1.C: New test.
	* c-c++-common/pr103798-2.c: Remove xfail.
parent 0695aba3
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment