Skip to content

Conversation

haonanya
Copy link

Fix build errors on APIntTest.cpp: error: call to constructor of 'APInt' is ambiguous
APInt ApUMax(32, UINT_MAX, false);
candidate constructor:
APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]);
APInt(unsigned numBits, uint64_t val, bool isSigned = false);

Fix build errors on APIntTest.cpp: error: call to constructor of 'APInt' is ambiguous
  APInt ApUMax(32, UINT_MAX, false);
  candidate constructor:
    APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]);
    APInt(unsigned numBits, uint64_t val, bool isSigned = false);
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot
Copy link
Member

llvmbot commented Mar 15, 2024

@llvm/pr-subscribers-llvm-adt

Author: Haonan Yang (haonanya)

Changes

Fix build errors on APIntTest.cpp: error: call to constructor of 'APInt' is ambiguous
APInt ApUMax(32, UINT_MAX, false);
candidate constructor:
APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]);
APInt(unsigned numBits, uint64_t val, bool isSigned = false);


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

1 Files Affected:

  • (modified) llvm/unittests/ADT/APIntTest.cpp (+1-1)
diff --git a/llvm/unittests/ADT/APIntTest.cpp b/llvm/unittests/ADT/APIntTest.cpp
index 400313a6234677..5d77ef798b3b65 100644
--- a/llvm/unittests/ADT/APIntTest.cpp
+++ b/llvm/unittests/ADT/APIntTest.cpp
@@ -2918,7 +2918,7 @@ TEST(APIntTest, Average) {
   APInt A100(32, 100);
   APInt A101(32, 101);
   APInt A200(32, 200, false);
-  APInt ApUMax(32, UINT_MAX, false);
+  APInt ApUMax(32, UINT_MAX);
 
   EXPECT_EQ(APInt(32, 150), APIntOps::avgFloorU(A100, A200));
   EXPECT_EQ(APIntOps::RoundingUDiv(A100 + A200, A2, APInt::Rounding::DOWN),

@haonanya
Copy link
Author

@Atousa, @RKSimon, @arsenm, could you please take a look? Thanks very much.

Copy link
Member

@kuhar kuhar left a comment

Choose a reason for hiding this comment

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

Other PR that tries to fix the same thing: #85341

@haonanya
Copy link
Author

Other PR that tries to fix the same thing: #85341

Thanks, let's wait for #85341.

@haonanya haonanya closed this Mar 15, 2024
@haonanya haonanya deleted the fix-windows branch March 15, 2024 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants