Commit fcb21722 by Jason Merrill Committed by Jason Merrill

re PR c++/49813 ([C++0x] sinh vs asinh vs constexpr)

	PR c++/49813
	* c-opts.c (set_std_cxx0x): Set flag_isoc94 and flag_isoc99.
	* c-pretty-print.c (pp_c_cv_qualifiers): Check c_dialect_cxx as well
	as flag_isoc99 for 'restrict'.
	(pp_c_specifier_qualifier_list): Likewise for _Complex.

From-SVN: r176635
parent 3de69514
2011-07-22 Jason Merrill <jason@redhat.com>
PR c++/49813
* c-opts.c (set_std_cxx0x): Set flag_isoc94 and flag_isoc99.
* c-pretty-print.c (pp_c_cv_qualifiers): Check c_dialect_cxx as well
as flag_isoc99 for 'restrict'.
(pp_c_specifier_qualifier_list): Likewise for _Complex.
2011-07-21 Ian Lance Taylor <iant@google.com> 2011-07-21 Ian Lance Taylor <iant@google.com>
PR middle-end/49705 PR middle-end/49705
......
...@@ -1488,6 +1488,9 @@ set_std_cxx0x (int iso) ...@@ -1488,6 +1488,9 @@ set_std_cxx0x (int iso)
flag_no_gnu_keywords = iso; flag_no_gnu_keywords = iso;
flag_no_nonansi_builtin = iso; flag_no_nonansi_builtin = iso;
flag_iso = iso; flag_iso = iso;
/* C++0x includes the C99 standard library. */
flag_isoc94 = 1;
flag_isoc99 = 1;
cxx_dialect = cxx0x; cxx_dialect = cxx0x;
} }
......
...@@ -205,7 +205,8 @@ pp_c_cv_qualifiers (c_pretty_printer *pp, int qualifiers, bool func_type) ...@@ -205,7 +205,8 @@ pp_c_cv_qualifiers (c_pretty_printer *pp, int qualifiers, bool func_type)
{ {
if (previous) if (previous)
pp_c_whitespace (pp); pp_c_whitespace (pp);
pp_c_ws_string (pp, flag_isoc99 ? "restrict" : "__restrict__"); pp_c_ws_string (pp, (flag_isoc99 && !c_dialect_cxx ()
? "restrict" : "__restrict__"));
} }
} }
...@@ -476,7 +477,8 @@ pp_c_specifier_qualifier_list (c_pretty_printer *pp, tree t) ...@@ -476,7 +477,8 @@ pp_c_specifier_qualifier_list (c_pretty_printer *pp, tree t)
case VECTOR_TYPE: case VECTOR_TYPE:
case COMPLEX_TYPE: case COMPLEX_TYPE:
if (code == COMPLEX_TYPE) if (code == COMPLEX_TYPE)
pp_c_ws_string (pp, flag_isoc99 ? "_Complex" : "__complex__"); pp_c_ws_string (pp, (flag_isoc99 && !c_dialect_cxx ()
? "_Complex" : "__complex__"));
else if (code == VECTOR_TYPE) else if (code == VECTOR_TYPE)
{ {
pp_c_ws_string (pp, "__vector"); pp_c_ws_string (pp, "__vector");
......
2011-07-22 Jason Merrill <jason@redhat.com>
PR c++/49813
* g++.dg/opt/builtins2.C: New.
* g++.dg/other/error27.C: Don't rely on __builtin.
2011-07-22 H.J. Lu <hongjiu.lu@intel.com> 2011-07-22 H.J. Lu <hongjiu.lu@intel.com>
* gcc/testsuite/gcc.target/i386/avx-vzeroupper-16.c: Only run * gcc/testsuite/gcc.target/i386/avx-vzeroupper-16.c: Only run
......
// PR c++/49813
// We should handle asinh as a built-in in C++0x mode, even when strict.
// { dg-options "-std=c++0x" }
// { dg-final { scan-assembler-not "asinh" } }
#include <math.h>
int main()
{
double das = asinh(1.0);
}
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
void foo (double x, double y) void foo (double x, double y)
{ {
__builtin_isgreater(x, y)(); // { dg-error "__builtin_\[^\n\]*cannot be used as a function" } __builtin_isgreater(x, y)(); // { dg-error "cannot be used as a function" }
__builtin_isless(x, y)(); // { dg-error "__builtin_\[^\n\]*cannot be used as a function" } __builtin_isless(x, y)(); // { dg-error "cannot be used as a function" }
__builtin_isgreaterequal(x, y)(); // { dg-error "__builtin_\[^\n\]*cannot be used as a function" } __builtin_isgreaterequal(x, y)(); // { dg-error "cannot be used as a function" }
__builtin_islessequal(x, y)(); // { dg-error "__builtin_\[^\n\]*cannot be used as a function" } __builtin_islessequal(x, y)(); // { dg-error "cannot be used as a function" }
__builtin_isunordered(x, y)(); // { dg-error "__builtin_\[^\n\]*cannot be used as a function" } __builtin_isunordered(x, y)(); // { dg-error "cannot be used as a function" }
__builtin_islessgreater(x, y)(); // { dg-error "__builtin_\[^\n\]*cannot be used as a function" } __builtin_islessgreater(x, y)(); // { dg-error "cannot be used as a function" }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment