Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang] Fix '__cdecl' CC is not supported for this target #74932

Merged
merged 1 commit into from
Dec 9, 2023

Conversation

RIscRIpt
Copy link
Member

@RIscRIpt RIscRIpt commented Dec 9, 2023

Fixes regression introduced in b3e6ff3

.---command stderr------------
| error: 'supported-warning' diagnostics seen but not expected:
|   File C:\buildbot\as-builder-1\x-armv7l\llvm-project\clang\test\SemaCXX\ms-constexpr-new.cpp Line 7: '__cdecl' calling convention is not supported for this target
| 1 error generated.
`-----------------------------

Fixes regression introduced in b3e6ff3

    .---command stderr------------
    | error: 'supported-warning' diagnostics seen but not expected:
    |   File C:\buildbot\as-builder-1\x-armv7l\llvm-project\clang\test\SemaCXX\ms-constexpr-new.cpp Line 7: '__cdecl' calling convention is not supported for this target
    | 1 error generated.
    `-----------------------------
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Dec 9, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Dec 9, 2023

@llvm/pr-subscribers-clang

Author: Richard Dzenis (RIscRIpt)

Changes

Fixes regression introduced in b3e6ff3

.---command stderr------------
| error: 'supported-warning' diagnostics seen but not expected:
|   File C:\buildbot\as-builder-1\x-armv7l\llvm-project\clang\test\SemaCXX\ms-constexpr-new.cpp Line 7: '__cdecl' calling convention is not supported for this target
| 1 error generated.
`-----------------------------

Full diff: https://github.com/llvm/llvm-project/pull/74932.diff

1 Files Affected:

  • (modified) clang/test/SemaCXX/ms-constexpr-new.cpp (+1-1)
diff --git a/clang/test/SemaCXX/ms-constexpr-new.cpp b/clang/test/SemaCXX/ms-constexpr-new.cpp
index 05ee5c5b4e154a..30567740b2ecbb 100644
--- a/clang/test/SemaCXX/ms-constexpr-new.cpp
+++ b/clang/test/SemaCXX/ms-constexpr-new.cpp
@@ -4,7 +4,7 @@
 
 [[nodiscard]]
 [[msvc::constexpr]] // unsupported-warning {{unknown attribute 'constexpr' ignored}}
-inline void* __cdecl operator new(decltype(sizeof(void*)), void* p) noexcept { return p; }
+inline void* operator new(decltype(sizeof(void*)), void* p) noexcept { return p; }
 
 namespace std {
   constexpr int* construct_at(int* p, int v) {

RIscRIpt referenced this pull request Dec 9, 2023
This commit introduces support for the MSVC-specific C++11-style
attribute `[[msvc::constexpr]]`, which was introduced in MSVC 14.33.
The semantics of this attribute are enabled only under
MSVC compatibility (`-fms-compatibility-version`) 14.33 and higher.
Additionally, the default value of `_MSC_VER` has been raised to 1433.

The current implementation lacks support for:
- `[[msvc::constexpr]]` constructors (see #72149);
  at the time of this implementation, such support would have required
  an unreasonable number of changes in Clang.
- `[[msvc::constexpr]] return ::new` (constexpr placement new) from
  non-std namespaces (see #74924).

Relevant to: #57696
Copy link
Contributor

@Endilll Endilll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but let's wait for CI to pass.

@Endilll Endilll merged commit 4cfdef7 into llvm:main Dec 9, 2023
5 checks passed
@RIscRIpt RIscRIpt deleted the msvc-constexpr-fix-ci branch December 9, 2023 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants