Commit 785f21af by Jason Merrill Committed by Jason Merrill

re PR c++/64956 (__GXX_ABI_VERSION needs a proper definition for the 5.x releases)

	PR c++/64956
	* c-opts.c (c_common_post_options): Change flag_abi_version from 0
	to the current highest version.
	* c-cppbuiltin.c (c_cpp_builtins): Assert that it isn't 0.

From-SVN: r220675
parent 6a1e352e
2015-02-12 Jason Merrill <jason@redhat.com>
PR c++/64956
* c-opts.c (c_common_post_options): Change flag_abi_version from 0
to the current highest version.
* c-cppbuiltin.c (c_cpp_builtins): Assert that it isn't 0.
2015-02-04 Jakub Jelinek <jakub@redhat.com>
PR c/64824
......
......@@ -891,14 +891,8 @@ c_cpp_builtins (cpp_reader *pfile)
/* Represents the C++ ABI version, always defined so it can be used while
preprocessing C and assembler. */
if (flag_abi_version == 0)
/* Use a very large value so that:
#if __GXX_ABI_VERSION >= <value for version X>
will work whether the user explicitly says "-fabi-version=x" or
"-fabi-version=0". Do not use INT_MAX because that will be
different from system to system. */
builtin_define_with_int_value ("__GXX_ABI_VERSION", 999999);
/* We should have set this to something real in c_common_post_options. */
gcc_unreachable ();
else if (flag_abi_version == 1)
/* Due to a historical accident, this version had the value
"102". */
......
......@@ -886,6 +886,11 @@ c_common_post_options (const char **pfilename)
warn_abi = false;
}
/* Change flag_abi_version to be the actual current ABI level for the
benefit of c_cpp_builtins. */
if (flag_abi_version == 0)
flag_abi_version = 8;
if (cxx_dialect >= cxx11)
{
/* If we're allowing C++0x constructs, don't warn about C++98
......
......@@ -806,7 +806,8 @@ Driver Undocumented
;
; 1: The version of the ABI first used in G++ 3.2. No longer selectable.
;
; 2: The version of the ABI first used in G++ 3.4 (and current default).
; 2: The version of the ABI first used in G++ 3.4, and the default
; until GCC 4.9.
;
; 3: The version of the ABI that fixes the missing underscore
; in template non-type arguments of pointer type.
......@@ -831,7 +832,8 @@ Driver Undocumented
;
; 8: The version of the ABI that corrects the substitution behavior of
; function types with function-cv-qualifiers.
; First selectable in G++ 4.9.
; First selectable in G++ 4.9 and default in G++ 5
; (set in c_common_post_options).
;
; Additional positive integers will be assigned as new versions of
; the ABI become the default version of the ABI.
......
// This testcase will need to be kept in sync with c_common_post_options.
// { dg-options "-fabi-version=0" }
#if __GXX_ABI_VERSION != 999999
#if __GXX_ABI_VERSION != 1008
#error "Incorrect value of __GXX_ABI_VERSION"
#endif
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