Add a little extra test coverage for simple template names
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 8 Jul 2022 00:11:09 +0000 (00:11 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 8 Jul 2022 00:12:29 +0000 (00:12 +0000)
This would fail with an overly naive approach to simple template
name (clang's -gsimple-template-names) since the names wouldn't be
unique per specialization, creating ambiguity/chance that a query for
one specialization would find another.

lldb/test/API/lang/cpp/complete-type-check/TestCppIsTypeComplete.py

index b596611b15f2fe8f28453aa3f56dae0af45de3e8..81a887674347413d45f8e87a2a77efeae9a024af 100644 (file)
@@ -14,6 +14,11 @@ class TestCase(TestBase):
         self.assertTrue(found_type.IsValid())
         self.assertTrue(found_type.IsTypeComplete())
 
+    def assertIsNotPresent(self, typename):
+        """ Asserts that the type with the given name is not found. """
+        found_type = self.target().FindFirstType(typename)
+        self.assertFalse(found_type.IsValid())
+
     def assertCompleteWithVar(self, typename):
         """ Asserts that the type with the given name is complete. """
         found_type = self.target().FindFirstType(typename)
@@ -41,6 +46,7 @@ class TestCase(TestBase):
         self.assertCompleteWithVar("DefinedClass")
         self.assertCompleteWithVar("DefinedClassTypedef")
         self.assertCompleteWithVar("DefinedTemplateClass<int>")
+        self.assertIsNotPresent("DefinedTemplateClass<long>")
 
         # Record types without a defining declaration are not complete.
         self.assertPointeeIncomplete("FwdClass *", "fwd_class")