aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2018-05-03 19:26:38 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2018-05-03 19:26:38 +0000
commit6c072e217f59a92136af99839ff7cab9065a4fa0 (patch)
treec1a46ca2286357bf1cd6337b1fd1a6c1d41c0f4e
parent503ac4e037217724c3c8d5468fb757ec398e8077 (diff)
downloadgcc-6c072e217f59a92136af99839ff7cab9065a4fa0.zip
gcc-6c072e217f59a92136af99839ff7cab9065a4fa0.tar.gz
gcc-6c072e217f59a92136af99839ff7cab9065a4fa0.tar.bz2
[C++ Patch] Kill -ffriend-injection
https://gcc.gnu.org/ml/gcc-patches/2018-05/msg00175.html * doc/extend.texi (Deprecated Features): Remove -ffriend-injection. (Backwards Compatibility): Likewise. * doc/invoke.texi (C++ Language Options): Likewise. (C++ Dialect Options): Likewise. c-family/ * c.opt (ffriend-injection): Remove functionality, issue warning. cp/ * decl.c (cxx_init_decl_processing): Remove flag_friend_injection. * name-lookup.c (do_pushdecl): Likewise. testsuite/ Remove -ffriend-injection. * g++.old-deja/g++.jason/scoping15.C: Delete. * g++.old-deja/g++.mike/net43.C: Delete. From-SVN: r259904
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/c-family/ChangeLog4
-rw-r--r--gcc/c-family/c.opt3
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c3
-rw-r--r--gcc/cp/name-lookup.c11
-rw-r--r--gcc/doc/extend.texi8
-rw-r--r--gcc/doc/invoke.texi13
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/scoping15.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net43.C12
11 files changed, 27 insertions, 71 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 549556a..df60e1f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2018-05-03 Nathan Sidwell <nathan@acm.org>
+
+ * doc/extend.texi (Deprecated Features): Remove
+ -ffriend-injection.
+ (Backwards Compatibility): Likewise.
+ * doc/invoke.texi (C++ Language Options): Likewise.
+ (C++ Dialect Options): Likewise.
+
2018-05-03 Jakub Jelinek <jakub@redhat.com>
PR target/85530
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index a6ae85f..56391e5 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,7 @@
+2018-05-03 Nathan Sidwell <nathan@acm.org>
+
+ * c.opt (ffriend-injection): Remove functionality, issue warning.
+
2018-05-01 David Malcolm <dmalcolm@redhat.com>
PR c/84258
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index a4c8c8f..5013501 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -1494,8 +1494,7 @@ C++ ObjC++ Var(flag_new_inheriting_ctors) Init(1)
Implement C++17 inheriting constructor semantics.
ffriend-injection
-C++ ObjC++ Var(flag_friend_injection)
-Inject friend functions into enclosing namespace.
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fkeep-inline-dllexport
C C++ ObjC ObjC++ Var(flag_keep_inline_dllexport) Init(1) Report Condition(TARGET_DLLIMPORT_DECL_ATTRIBUTES)
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index fadcea8..25cb43a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2018-05-03 Nathan Sidwell <nathan@acm.org>
+
+ * decl.c (cxx_init_decl_processing): Remove flag_friend_injection.
+ * name-lookup.c (do_pushdecl): Likewise.
+
2018-05-02 Paolo Carlini <paolo.carlini@oracle.com>
Jason Merrill <jason@redhat.com>
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 6f2fe01..5e67181 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4175,9 +4175,6 @@ cxx_init_decl_processing (void)
if (!flag_new_for_scope)
warning_at (UNKNOWN_LOCATION, OPT_Wdeprecated,
"%<-fno-for-scope%> is deprecated");
- if (flag_friend_injection)
- warning_at (UNKNOWN_LOCATION, OPT_Wdeprecated,
- "%<-ffriend-injection%> is deprecated");
c_common_nodes_and_builtins ();
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 08cabd6..9710add 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -3055,7 +3055,6 @@ do_pushdecl (tree decl, bool is_friend)
old = OVL_CHAIN (old);
check_template_shadow (decl);
- bool visible_injection = false;
if (DECL_DECLARES_FUNCTION_P (decl))
{
@@ -3073,11 +3072,8 @@ do_pushdecl (tree decl, bool is_friend)
/* Don't attempt to push it. */
return error_mark_node;
}
- if (!flag_friend_injection)
- /* Hide it from ordinary lookup. */
- DECL_ANTICIPATED (decl) = DECL_HIDDEN_FRIEND_P (decl) = true;
- else
- visible_injection = true;
+ /* Hide it from ordinary lookup. */
+ DECL_ANTICIPATED (decl) = DECL_HIDDEN_FRIEND_P (decl) = true;
}
}
@@ -3129,9 +3125,6 @@ do_pushdecl (tree decl, bool is_friend)
}
else if (VAR_P (decl))
maybe_register_incomplete_var (decl);
- else if (visible_injection)
- warning (0, "injected friend %qD is visible"
- " due to %<-ffriend-injection%>", decl);
if ((VAR_P (decl) || TREE_CODE (decl) == FUNCTION_DECL)
&& DECL_EXTERN_C_P (decl))
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index f751b08..253aea1 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -23846,8 +23846,7 @@ that are now deprecated or have been removed:
@table @code
@item -fno-for-scope
-@itemx -ffriend-injection
-These two options provide compatibility with pre-standard C++.
+This option provides compatibility with pre-standard C++.
@xref{Backwards Compatibility}.
@end table
@@ -23907,11 +23906,6 @@ The behavior is deprecated, only available with @option{-std=c++98}
@option{-fpermissive} option to enable it. The behavior will be
removed.
-@item Friend Injection
-The @option{-ffriend-injection} option makes injected friends visible
-to regular name lookup, unlike standard C++. This option is
-deprecated and will be removed.
-
@item Implicit C language
Old C system header files did not contain an @code{extern "C" @{@dots{}@}}
scope to set the language. On such systems, all header files are
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index b3d23aa..3de372f 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -193,7 +193,6 @@ in the following sections.
@gccoptlist{-fabi-version=@var{n} -fno-access-control @gol
-faligned-new=@var{n} -fargs-in-order=@var{n} -fcheck-new @gol
-fconstexpr-depth=@var{n} -fconstexpr-loop-limit=@var{n} @gol
--ffriend-injection @gol
-fno-elide-constructors @gol
-fno-enforce-eh-specs @gol
-ffor-scope -fno-for-scope -fno-gnu-keywords @gol
@@ -2448,18 +2447,6 @@ originally proposed semantics for the C++11 standard, but was not part
of the final standard, so it is disabled by default. This option is
deprecated, and may be removed in a future version of G++.
-@item -ffriend-injection
-@opindex ffriend-injection
-Inject friend functions into the enclosing namespace, so that they are
-visible outside the scope of the class in which they are declared.
-Friend functions were documented to work this way in the old Annotated
-C++ Reference Manual.
-However, in ISO C++ a friend function that is not declared
-in an enclosing scope can only be found using argument dependent
-lookup. GCC defaults to the standard behavior.
-
-This option is deprecated and will be removed.
-
@item -fno-elide-constructors
@opindex fno-elide-constructors
The C++ standard allows an implementation to omit creating a temporary
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0166e6e..3ea8760 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2018-05-03 Nathan Sidwell <nathan@acm.org>
+
+ Remove -ffriend-injection.
+ * g++.old-deja/g++.jason/scoping15.C: Delete.
+ * g++.old-deja/g++.mike/net43.C: Delete.
+
2018-05-03 Jakub Jelinek <jakub@redhat.com>
PR target/85530
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/scoping15.C b/gcc/testsuite/g++.old-deja/g++.jason/scoping15.C
deleted file mode 100644
index c677b0d..0000000
--- a/gcc/testsuite/g++.old-deja/g++.jason/scoping15.C
+++ /dev/null
@@ -1,25 +0,0 @@
-// { dg-do assemble }
-// { dg-options "-ffriend-injection" }
-// Bug: g++ ignores the :: qualification and dies trying to treat an integer
-// variable as a list of functions.
-
-class DComplex;
-double imag (const DComplex&);
-
-class DComplex {
-public:
- friend double imag(const DComplex& a); // Not injected, no warning
-};
-
-class FComplex {
-public:
- friend float imag(const FComplex& a); // { dg-warning "is visible" }
-};
-
-void
-scnrm2(FComplex cx[])
-{
- int imag;
- ::imag( cx[0] );
-}
-// { dg-warning "ffriend-injection.* is deprecated" "cc1plus:" { target *-*-* } 0 }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net43.C b/gcc/testsuite/g++.old-deja/g++.mike/net43.C
deleted file mode 100644
index de266de..0000000
--- a/gcc/testsuite/g++.old-deja/g++.mike/net43.C
+++ /dev/null
@@ -1,12 +0,0 @@
-// { dg-do assemble }
-// { dg-options "-ffriend-injection -Wno-deprecated" }
-
-class foo {
- public:
- friend int operator ^(const foo&, const foo&); // { dg-message "is visible" }
-};
-
-int main ()
-{
- int (*funptr) (const foo &, const foo &) = operator ^;
-}