diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -431,7 +431,7 @@ attribute is also specified on the member. Clang historically did perform such packing. Clang now matches the gcc behavior (except on Darwin and PS4). You can switch back to the old ABI behavior with the flag: - ``-fclang-abi-compat=13.0``. + ``-fclang-abi-compat=14.0``. OpenMP Support in Clang ----------------------- diff --git a/clang/include/clang/Basic/LangOptions.h b/clang/include/clang/Basic/LangOptions.h --- a/clang/include/clang/Basic/LangOptions.h +++ b/clang/include/clang/Basic/LangOptions.h @@ -214,12 +214,9 @@ /// global-scope inline variables incorrectly. Ver12, - /// Attempt to be ABI-compatible with code generated by Clang 13.0.x. - /// This causes clang to not pack non-POD members of packed structs. - Ver13, - /// Attempt to be ABI-compatible with code generated by Clang 14.0.x. /// This causes clang to mangle dependent nested names incorrectly. + /// This causes clang to pack non-POD members of packed structs. Ver14, /// Conform to the underlying platform's C and C++ ABIs as closely diff --git a/clang/lib/AST/RecordLayoutBuilder.cpp b/clang/lib/AST/RecordLayoutBuilder.cpp --- a/clang/lib/AST/RecordLayoutBuilder.cpp +++ b/clang/lib/AST/RecordLayoutBuilder.cpp @@ -1890,7 +1890,7 @@ llvm::Triple Target = Context.getTargetInfo().getTriple(); bool FieldPacked = (Packed && (!FieldClass || FieldClass->isPOD() || Context.getLangOpts().getClangABICompat() <= - LangOptions::ClangABI::Ver13 || + LangOptions::ClangABI::Ver14 || Target.isPS4() || Target.isOSDarwin())) || D->hasAttr(); diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3516,8 +3516,6 @@ GenerateArg(Args, OPT_fclang_abi_compat_EQ, "11.0", SA); else if (Opts.getClangABICompat() == LangOptions::ClangABI::Ver12) GenerateArg(Args, OPT_fclang_abi_compat_EQ, "12.0", SA); - else if (Opts.getClangABICompat() == LangOptions::ClangABI::Ver13) - GenerateArg(Args, OPT_fclang_abi_compat_EQ, "13.0", SA); else if (Opts.getClangABICompat() == LangOptions::ClangABI::Ver14) GenerateArg(Args, OPT_fclang_abi_compat_EQ, "14.0", SA); @@ -4010,8 +4008,6 @@ Opts.setClangABICompat(LangOptions::ClangABI::Ver11); else if (Major <= 12) Opts.setClangABICompat(LangOptions::ClangABI::Ver12); - else if (Major <= 13) - Opts.setClangABICompat(LangOptions::ClangABI::Ver13); else if (Major <= 14) Opts.setClangABICompat(LangOptions::ClangABI::Ver14); } else if (Ver != "latest") { diff --git a/clang/test/SemaCXX/class-layout.cpp b/clang/test/SemaCXX/class-layout.cpp --- a/clang/test/SemaCXX/class-layout.cpp +++ b/clang/test/SemaCXX/class-layout.cpp @@ -1,9 +1,9 @@ // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++98 -Wno-inaccessible-base // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -DCLANG_ABI_COMPAT=13 +// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -DCLANG_ABI_COMPAT=14 // RUN: %clang_cc1 -triple x86_64-scei-ps4 %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -DCLANG_ABI_COMPAT=6 // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -fclang-abi-compat=6 -DCLANG_ABI_COMPAT=6 -// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -fclang-abi-compat=13 -DCLANG_ABI_COMPAT=13 +// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -fclang-abi-compat=14 -DCLANG_ABI_COMPAT=14 // expected-no-diagnostics #define SA(n, p) int a##n[(p) ? 1 : -1] @@ -620,7 +620,7 @@ char c2; t1 v1; } __attribute__((packed)); -#if defined(CLANG_ABI_COMPAT) && CLANG_ABI_COMPAT <= 13 +#if defined(CLANG_ABI_COMPAT) && CLANG_ABI_COMPAT <= 14 _Static_assert(_Alignof(t1) == 4, ""); _Static_assert(_Alignof(t2) == 1, ""); #else