[llvm] c94ce0c - [ADT] Fix warnings
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 18 19:59:18 PST 2024
Author: Kazu Hirata
Date: 2024-12-18T19:59:11-08:00
New Revision: c94ce0cca25229cd0e38560ad6e56a1a2f9a0c8b
URL: https://github.com/llvm/llvm-project/commit/c94ce0cca25229cd0e38560ad6e56a1a2f9a0c8b
DIFF: https://github.com/llvm/llvm-project/commit/c94ce0cca25229cd0e38560ad6e56a1a2f9a0c8b.diff
LOG: [ADT] Fix warnings
This patch fixes warnings of the form:
llvm/unittests/ADT/ScopedHashTableTest.cpp:41:20: error:
'ScopedHashTableScope' may not intend to support class template
argument deduction [-Werror,-Wctad-maybe-unsupported]
Added:
Modified:
llvm/unittests/ADT/ScopedHashTableTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/ADT/ScopedHashTableTest.cpp b/llvm/unittests/ADT/ScopedHashTableTest.cpp
index 64afa948d9a17f..8ce5c7cecf998e 100644
--- a/llvm/unittests/ADT/ScopedHashTableTest.cpp
+++ b/llvm/unittests/ADT/ScopedHashTableTest.cpp
@@ -38,37 +38,45 @@ TEST_F(ScopedHashTableTest, AccessWithNoActiveScope) {
}
TEST_F(ScopedHashTableTest, AccessWithAScope) {
- [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
+ [[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> varScope(
+ symbolTable);
EXPECT_EQ(symbolTable.count(kGlobalName), 1U);
}
TEST_F(ScopedHashTableTest, InsertInScope) {
- [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
+ [[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> varScope(
+ symbolTable);
symbolTable.insert(kLocalName, kLocalValue);
EXPECT_EQ(symbolTable.count(kLocalName), 1U);
}
TEST_F(ScopedHashTableTest, InsertInLinearSortedScope) {
- [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
- [[maybe_unused]] ScopedHashTableScope varScope2(symbolTable);
- [[maybe_unused]] ScopedHashTableScope varScope3(symbolTable);
+ [[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> varScope(
+ symbolTable);
+ [[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> varScope2(
+ symbolTable);
+ [[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> varScope3(
+ symbolTable);
symbolTable.insert(kLocalName, kLocalValue);
EXPECT_EQ(symbolTable.count(kLocalName), 1U);
}
TEST_F(ScopedHashTableTest, InsertInOutedScope) {
{
- [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
+ [[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> varScope(
+ symbolTable);
symbolTable.insert(kLocalName, kLocalValue);
}
EXPECT_EQ(symbolTable.count(kLocalName), 0U);
}
TEST_F(ScopedHashTableTest, OverrideInScope) {
- [[maybe_unused]] ScopedHashTableScope funScope(symbolTable);
+ [[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> funScope(
+ symbolTable);
symbolTable.insert(kLocalName, kLocalValue);
{
- [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
+ [[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> varScope(
+ symbolTable);
symbolTable.insert(kLocalName, kLocalValue2);
EXPECT_EQ(symbolTable.lookup(kLocalName), kLocalValue2);
}
@@ -78,11 +86,11 @@ TEST_F(ScopedHashTableTest, OverrideInScope) {
TEST_F(ScopedHashTableTest, GetCurScope) {
EXPECT_EQ(symbolTable.getCurScope(), &globalScope);
{
- ScopedHashTableScope funScope(symbolTable);
- ScopedHashTableScope funScope2(symbolTable);
+ ScopedHashTableScope<StringRef, StringRef> funScope(symbolTable);
+ ScopedHashTableScope<StringRef, StringRef> funScope2(symbolTable);
EXPECT_EQ(symbolTable.getCurScope(), &funScope2);
{
- ScopedHashTableScope blockScope(symbolTable);
+ ScopedHashTableScope<StringRef, StringRef> blockScope(symbolTable);
EXPECT_EQ(symbolTable.getCurScope(), &blockScope);
}
EXPECT_EQ(symbolTable.getCurScope(), &funScope2);
More information about the llvm-commits
mailing list