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