================
@@ -530,6 +530,43 @@ def test_pretty(self):
pp.set_property(PrintingPolicyProperty.SuppressTagKeyword, False)
self.assertEqual(f.type.get_canonical().pretty_printed(pp), "struct X")
+ def test_non_reference(self):
+ source = """
+ int dummy;
+ int &reference;
+ """
+ tu = get_tu(source, lang="cpp")
+ dummy = get_cursor(tu, "dummy")
+ reference = get_cursor(tu, "reference")
+ self.assertEqual(reference.type.get_non_reference().spelling, "int")
+ self.assertEqual(dummy.type.spelling,
dummy.type.get_non_reference().spelling)
----------------
Endilll wrote:
`Type.get_ref_qualifiers()` can be used to check that `get_non_reference()` did
its job without using `dummy`.
https://github.com/llvm/llvm-project/pull/175534
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits