aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-11-01 00:02:56 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-11-01 00:02:56 -0400
commit15694fdd6d84dbed29898eff5caabc807d4f3067 (patch)
tree9be46ffc212bb0b65d9fb954a357a2e2252fb64f /gcc
parenta7d5d7e221f85f6afc574beaa9d2dcabc67368d7 (diff)
downloadgcc-15694fdd6d84dbed29898eff5caabc807d4f3067.zip
gcc-15694fdd6d84dbed29898eff5caabc807d4f3067.tar.gz
gcc-15694fdd6d84dbed29898eff5caabc807d4f3067.tar.bz2
* c.opt (-fdeduce-init-list): Off by default.
From-SVN: r180728
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-family/ChangeLog2
-rw-r--r--gcc/c-family/c.opt4
-rw-r--r--gcc/doc/invoke.texi13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist-deduce.C2
4 files changed, 12 insertions, 9 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index d77004e..028163c 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,5 +1,7 @@
2011-10-31 Jason Merrill <jason@redhat.com>
+ * c.opt (-fdeduce-init-list): Off by default.
+
PR c++/50920
* c-common.h (cxx_dialect): Add cxx11 and cxx03.
* c.opt: Add -std=c++11, -std=gnu++11, -std=gnu++03,
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 336a75a..6d50097 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -752,8 +752,8 @@ C ObjC C++ ObjC++
Emit debug annotations during preprocessing
fdeduce-init-list
-C++ ObjC++ Var(flag_deduce_init_list) Init(1)
--fno-deduce-init-list disable deduction of std::initializer_list for a template type parameter from a brace-enclosed initializer-list
+C++ ObjC++ Var(flag_deduce_init_list) Init(0)
+-fdeduce-init-list enable deduction of std::initializer_list for a template type parameter from a brace-enclosed initializer-list
fdefault-inline
C++ ObjC++ Ignore
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 0c97453..2836b74 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -1907,9 +1907,9 @@ to @var{n}. A limit is needed to detect endless recursion during
constant expression evaluation. The minimum specified by the standard
is 512.
-@item -fno-deduce-init-list
-@opindex fno-deduce-init-list
-Disable deduction of a template type parameter as
+@item -fdeduce-init-list
+@opindex fdeduce-init-list
+Enable deduction of a template type parameter as
std::initializer_list from a brace-enclosed initializer list, i.e.
@smallexample
@@ -1924,9 +1924,10 @@ void f()
@}
@end smallexample
-This option is present because this deduction is an extension to the
-current specification in the C++0x working draft, and there was
-some concern about potential overload resolution problems.
+This deduction was implemented as a possible extension to the
+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
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist-deduce.C b/gcc/testsuite/g++.dg/cpp0x/initlist-deduce.C
index e422132..373044f 100644
--- a/gcc/testsuite/g++.dg/cpp0x/initlist-deduce.C
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist-deduce.C
@@ -2,7 +2,7 @@
// supported by the working draft, but is necessary for perfect forwarding
// of initializer-lists to things that can take a std::initializer_list.
-// { dg-options -std=c++0x }
+// { dg-options "-std=c++0x -fdeduce-init-list" }
// { dg-do run }
#include <initializer_list>