From b0957daf070e13e7c298370996e2db3a6ca3c959 Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Fri, 27 Mar 2009 13:28:44 +0000 Subject: [PATCH] re PR c++/36799 ([c++0x] error on va_copy in -std=c++0x mode) gcc/ 2009-03-27 Andrew Pinski PR c++/36799 * ginclude/stdarg.h (va_copy): Define also for __GXX_EXPERIMENTAL_CXX0X__. gcc/testsuite/ 2009-03-27 Andrew Pinski PR c++/36799 * g++.dg/other/var_copy-1.C: New test. From-SVN: r145106 --- gcc/ChangeLog | 5 +++++ gcc/ginclude/stdarg.h | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/other/var_copy-1.C | 14 ++++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/other/var_copy-1.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fbb0ae5bdf6..9245f6b2b47 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-03-27 Andrew Pinski + + PR c++/36799 + * ginclude/stdarg.h (va_copy): Define also for __GXX_EXPERIMENTAL_CXX0X__. + 2009-03-27 Manuel Lopez-Ibanez PR c++/35652 diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h index c9ddd6b7fc1..5061f34e119 100644 --- a/gcc/ginclude/stdarg.h +++ b/gcc/ginclude/stdarg.h @@ -50,7 +50,7 @@ typedef __builtin_va_list __gnuc_va_list; #define va_start(v,l) __builtin_va_start(v,l) #define va_end(v) __builtin_va_end(v) #define va_arg(v,l) __builtin_va_arg(v,l) -#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L +#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L || defined(__GXX_EXPERIMENTAL_CXX0X__) #define va_copy(d,s) __builtin_va_copy(d,s) #endif #define __va_copy(d,s) __builtin_va_copy(d,s) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 82fc8ab70ca..1a3843e3707 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-03-27 Andrew Pinski + + PR c++/36799 + * g++.dg/other/var_copy-1.C: New test. + 2009-03-27 Simon Martin PR c++/37647 diff --git a/gcc/testsuite/g++.dg/other/var_copy-1.C b/gcc/testsuite/g++.dg/other/var_copy-1.C new file mode 100644 index 00000000000..2fc6b780e18 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/var_copy-1.C @@ -0,0 +1,14 @@ +// { dg-options "-std=c++0x" } +// { dg-do compile } + +// Test to allow for va_copy with C++0x standard. + +#include + +va_list x; +va_list y; + +int main () +{ + va_copy (y, x); +}