050-gcc-6-compile.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. Upstream commit r233720
  2. diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
  3. index 68acd3d..214ecf6 100644
  4. --- a/gcc/cp/cfns.gperf
  5. +++ b/gcc/cp/cfns.gperf
  6. @@ -1,3 +1,5 @@
  7. +%language=C++
  8. +%define class-name libc_name
  9. %{
  10. /* Copyright (C) 2000-2015 Free Software Foundation, Inc.
  11. @@ -16,14 +18,6 @@ for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GCC; see the file COPYING3. If not see
  14. <http://www.gnu.org/licenses/>. */
  15. -#ifdef __GNUC__
  16. -__inline
  17. -#endif
  18. -static unsigned int hash (const char *, unsigned int);
  19. -#ifdef __GNUC__
  20. -__inline
  21. -#endif
  22. -const char * libc_name_p (const char *, unsigned int);
  23. %}
  24. %%
  25. # The standard C library functions, for feeding to gperf; the result is used
  26. diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
  27. index 1c6665d..596f413 100644
  28. --- a/gcc/cp/cfns.h
  29. +++ b/gcc/cp/cfns.h
  30. @@ -1,5 +1,5 @@
  31. -/* ANSI-C code produced by gperf version 3.0.3 */
  32. -/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */
  33. +/* C++ code produced by gperf version 3.0.4 */
  34. +/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf */
  35. #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
  36. && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
  37. @@ -28,7 +28,7 @@
  38. #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
  39. #endif
  40. -#line 1 "cfns.gperf"
  41. +#line 3 "cfns.gperf"
  42. /* Copyright (C) 2000-2015 Free Software Foundation, Inc.
  43. @@ -47,25 +47,18 @@ for more details.
  44. You should have received a copy of the GNU General Public License
  45. along with GCC; see the file COPYING3. If not see
  46. <http://www.gnu.org/licenses/>. */
  47. -#ifdef __GNUC__
  48. -__inline
  49. -#endif
  50. -static unsigned int hash (const char *, unsigned int);
  51. -#ifdef __GNUC__
  52. -__inline
  53. -#endif
  54. -const char * libc_name_p (const char *, unsigned int);
  55. /* maximum key range = 391, duplicates = 0 */
  56. -#ifdef __GNUC__
  57. -__inline
  58. -#else
  59. -#ifdef __cplusplus
  60. -inline
  61. -#endif
  62. -#endif
  63. -static unsigned int
  64. -hash (register const char *str, register unsigned int len)
  65. +class libc_name
  66. +{
  67. +private:
  68. + static inline unsigned int hash (const char *str, unsigned int len);
  69. +public:
  70. + static const char *libc_name_p (const char *str, unsigned int len);
  71. +};
  72. +
  73. +inline unsigned int
  74. +libc_name::hash (register const char *str, register unsigned int len)
  75. {
  76. static const unsigned short asso_values[] =
  77. {
  78. @@ -122,14 +115,8 @@ hash (register const char *str, register unsigned int len)
  79. return hval + asso_values[(unsigned char)str[len - 1]];
  80. }
  81. -#ifdef __GNUC__
  82. -__inline
  83. -#ifdef __GNUC_STDC_INLINE__
  84. -__attribute__ ((__gnu_inline__))
  85. -#endif
  86. -#endif
  87. const char *
  88. -libc_name_p (register const char *str, register unsigned int len)
  89. +libc_name::libc_name_p (register const char *str, register unsigned int len)
  90. {
  91. enum
  92. {
  93. diff --git a/gcc/cp/except.c b/gcc/cp/except.c
  94. index 3ff1ce6..2f2e396 100644
  95. --- a/gcc/cp/except.c
  96. +++ b/gcc/cp/except.c
  97. @@ -1040,7 +1040,8 @@ nothrow_libfn_p (const_tree fn)
  98. unless the system headers are playing rename tricks, and if
  99. they are, we don't want to be confused by them. */
  100. id = DECL_NAME (fn);
  101. - return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
  102. + return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id),
  103. + IDENTIFIER_LENGTH (id));
  104. }
  105. /* Returns nonzero if an exception of type FROM will be caught by a
  106. --
  107. 1.7.1