Skip to content

Commit c94ce0c

Browse files
[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]
1 parent fe26853 commit c94ce0c

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

llvm/unittests/ADT/ScopedHashTableTest.cpp

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,37 +38,45 @@ TEST_F(ScopedHashTableTest, AccessWithNoActiveScope) {
3838
}
3939

4040
TEST_F(ScopedHashTableTest, AccessWithAScope) {
41-
[[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
41+
[[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> varScope(
42+
symbolTable);
4243
EXPECT_EQ(symbolTable.count(kGlobalName), 1U);
4344
}
4445

4546
TEST_F(ScopedHashTableTest, InsertInScope) {
46-
[[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
47+
[[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> varScope(
48+
symbolTable);
4749
symbolTable.insert(kLocalName, kLocalValue);
4850
EXPECT_EQ(symbolTable.count(kLocalName), 1U);
4951
}
5052

5153
TEST_F(ScopedHashTableTest, InsertInLinearSortedScope) {
52-
[[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
53-
[[maybe_unused]] ScopedHashTableScope varScope2(symbolTable);
54-
[[maybe_unused]] ScopedHashTableScope varScope3(symbolTable);
54+
[[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> varScope(
55+
symbolTable);
56+
[[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> varScope2(
57+
symbolTable);
58+
[[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> varScope3(
59+
symbolTable);
5560
symbolTable.insert(kLocalName, kLocalValue);
5661
EXPECT_EQ(symbolTable.count(kLocalName), 1U);
5762
}
5863

5964
TEST_F(ScopedHashTableTest, InsertInOutedScope) {
6065
{
61-
[[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
66+
[[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> varScope(
67+
symbolTable);
6268
symbolTable.insert(kLocalName, kLocalValue);
6369
}
6470
EXPECT_EQ(symbolTable.count(kLocalName), 0U);
6571
}
6672

6773
TEST_F(ScopedHashTableTest, OverrideInScope) {
68-
[[maybe_unused]] ScopedHashTableScope funScope(symbolTable);
74+
[[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> funScope(
75+
symbolTable);
6976
symbolTable.insert(kLocalName, kLocalValue);
7077
{
71-
[[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
78+
[[maybe_unused]] ScopedHashTableScope<StringRef, StringRef> varScope(
79+
symbolTable);
7280
symbolTable.insert(kLocalName, kLocalValue2);
7381
EXPECT_EQ(symbolTable.lookup(kLocalName), kLocalValue2);
7482
}
@@ -78,11 +86,11 @@ TEST_F(ScopedHashTableTest, OverrideInScope) {
7886
TEST_F(ScopedHashTableTest, GetCurScope) {
7987
EXPECT_EQ(symbolTable.getCurScope(), &globalScope);
8088
{
81-
ScopedHashTableScope funScope(symbolTable);
82-
ScopedHashTableScope funScope2(symbolTable);
89+
ScopedHashTableScope<StringRef, StringRef> funScope(symbolTable);
90+
ScopedHashTableScope<StringRef, StringRef> funScope2(symbolTable);
8391
EXPECT_EQ(symbolTable.getCurScope(), &funScope2);
8492
{
85-
ScopedHashTableScope blockScope(symbolTable);
93+
ScopedHashTableScope<StringRef, StringRef> blockScope(symbolTable);
8694
EXPECT_EQ(symbolTable.getCurScope(), &blockScope);
8795
}
8896
EXPECT_EQ(symbolTable.getCurScope(), &funScope2);

0 commit comments

Comments
 (0)