Skip to content

[Clang][Sema] placement new initializes typedef array with correct size #88902

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

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

mahtohappy
Copy link
Contributor

Build Failure Fix
Fixes build failures due to #83124

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Apr 16, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 16, 2024

@llvm/pr-subscribers-clang

Author: None (mahtohappy)

Changes

Build Failure Fix
Fixes build failures due to #83124


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

1 Files Affected:

  • (renamed) clang/test/SemaCXX/PR41441.cpp (+1-1)
diff --git a/clang/test/SemaCXX/instantiate-new-placement-size.cpp b/clang/test/SemaCXX/PR41441.cpp
similarity index 95%
rename from clang/test/SemaCXX/instantiate-new-placement-size.cpp
rename to clang/test/SemaCXX/PR41441.cpp
index 7a29d3dee8491e..ecc8594dfff67a 100644
--- a/clang/test/SemaCXX/instantiate-new-placement-size.cpp
+++ b/clang/test/SemaCXX/PR41441.cpp
@@ -1,5 +1,5 @@
 // RUN: %clang -S -fno-discard-value-names -emit-llvm -o - %s | FileCheck %s
-// Issue no: 41441
+
 #include <new>
 
 // CHECK: call void @llvm.memset.p0.i64(ptr align 1 %x, i8 0, i64 8, i1 false)

Copy link
Collaborator

@erichkeane erichkeane left a comment

Choose a reason for hiding this comment

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

This should be fine to just merge, don't need to wait for pre-commit CI.

// RUN: %clang -S -fno-discard-value-names -emit-llvm -o - %s | FileCheck %s
// Issue no: 41441
// RUN: %clang --target=x86_64-pc-linux -S -fno-discard-value-names -emit-llvm -o - %s | FileCheck %s

#include <new>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This #include is also possible to cause breakages, you should just put hte important declarations in text.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It does:

https://lab.llvm.org/buildbot/#/builders/280/builds/1989

/Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/clang/test/SemaCXX/PR41441.cpp:3:10: fatal error: 'new' file not found
    3 | #include <new>
      |          ^~~~~
1 error generated.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Blarg, the buildbots i checked on were mangling differences. I'll fix this locally as I suggested and get a fix merged ASAP.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be good as of 0a789ea

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

@erichkeane erichkeane merged commit 5c6af60 into llvm:main Apr 16, 2024
erichkeane added a commit that referenced this pull request Apr 16, 2024
This just replaces an '#include<new>' with a declaration of array
placement new.
metaflow added a commit that referenced this pull request Apr 17, 2024
This reverts commit 0a789ea.

Breaks builds, see discussion in #83124
metaflow added a commit that referenced this pull request Apr 17, 2024
…rrect size (#88902)"

This reverts commit 5c6af60.

Breaks builds, see discussion in #83124
mahtohappy added a commit to mahtohappy/llvm-project that referenced this pull request Apr 17, 2024
mahtohappy pushed a commit to mahtohappy/llvm-project that referenced this pull request Apr 17, 2024
This just replaces an '#include<new>' with a declaration of array
placement new.
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.

5 participants