From: Michal Gorny Date: Sat, 11 Nov 2017 20:01:41 +0000 (+0000) Subject: [python] [tests] Fix test_linkage for unique external linkage X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a748214a43e14a3bd48c8aa2c20b7226c12575f3;p=clang [python] [tests] Fix test_linkage for unique external linkage Starting with r314037, anonymous namespaces no longer give unique-external linkage to variables. However, this linkage can still be achieved by using a type which is not exterally visible, e.g. through being declared in an anonymous namespace but used outside it. Fix the test to take advantage of that. Differential Revision: https://reviews.llvm.org/D39810 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317986 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/bindings/python/tests/cindex/test_linkage.py b/bindings/python/tests/cindex/test_linkage.py index 37223c2adb..6b482f8081 100644 --- a/bindings/python/tests/cindex/test_linkage.py +++ b/bindings/python/tests/cindex/test_linkage.py @@ -15,7 +15,8 @@ class TestLinkage(unittest.TestCase): tu = get_tu(""" void foo() { int no_linkage; } static int internal; -namespace { extern int unique_external; } +namespace { struct unique_external_type {} } +unique_external_type unique_external; extern int external; """, lang = 'cpp')