]> granicus.if.org Git - clang/commitdiff
[python] [tests] Fix test_linkage for unique external linkage
authorMichal Gorny <mgorny@gentoo.org>
Sat, 11 Nov 2017 20:01:41 +0000 (20:01 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Sat, 11 Nov 2017 20:01:41 +0000 (20:01 +0000)
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

bindings/python/tests/cindex/test_linkage.py

index 37223c2adb61067780f36b7795cbe52aebada4e3..6b482f8081b3a8266d0f50ee9e5fb3ec0cd1f250 100644 (file)
@@ -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')