030-gcc-6-compile.patch 3.8 KB

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