dfa500
commit 953ceff17a4a15b10cfdd5edc3c8cae4884c8ec3
dfa500
Author: Kamlesh Kumar <kamleshbhalui@gmail.com>
dfa500
Date:   Thu Dec 5 16:49:00 2019 +0100
dfa500
dfa500
    <string.h>: Define __CORRECT_ISO_CPP_STRING_H_PROTO for Clang [BZ #25232]
dfa500
    
dfa500
    Without the asm redirects, strchr et al. are not const-correct.
dfa500
    
dfa500
    libc++ has a wrapper header that works with and without
dfa500
    __CORRECT_ISO_CPP_STRING_H_PROTO (using a Clang extension).  But when
dfa500
    Clang is used with libstdc++ or just C headers, the overloaded functions
dfa500
    with the correct types are not declared.
dfa500
    
dfa500
    This change does not impact current GCC (with libstdc++ or libc++).
dfa500
dfa500
diff --git a/string/string.h b/string/string.h
dfa500
index 73c22a535a..faf997b972 100644
dfa500
--- a/string/string.h
dfa500
+++ b/string/string.h
dfa500
@@ -33,7 +33,8 @@ __BEGIN_DECLS
dfa500
 #include <stddef.h>
dfa500
 
dfa500
 /* Tell the caller that we provide correct C++ prototypes.  */
dfa500
-#if defined __cplusplus && __GNUC_PREREQ (4, 4)
dfa500
+#if defined __cplusplus && (__GNUC_PREREQ (4, 4) \
dfa500
+			    || __glibc_clang_prereq (3, 5))
dfa500
 # define __CORRECT_ISO_CPP_STRING_H_PROTO
dfa500
 #endif
dfa500