diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-04-18 21:01:23 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-04-18 21:01:23 +0000 |
commit | 65ad5a42cca954e070428dcc499b62393aa7a6d3 (patch) | |
tree | de23c5c8fa2c980ccc3d6428af868ea9073e178b /test/CodeGenCXX/static-local-in-local-class.cpp | |
parent | a75b71f967d7f090ef16a3d255baddbdce7ff81e (diff) |
Local static variables must be available module-wise
as they are accessible in static methods in a class
local to the same function. Fixes PR6769.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101756 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/static-local-in-local-class.cpp')
-rw-r--r-- | test/CodeGenCXX/static-local-in-local-class.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGenCXX/static-local-in-local-class.cpp b/test/CodeGenCXX/static-local-in-local-class.cpp new file mode 100644 index 0000000000..d9e044ce9d --- /dev/null +++ b/test/CodeGenCXX/static-local-in-local-class.cpp @@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -emit-llvm -o %t %s +// PR6769 + +struct X { + static void f(); +}; + +void X::f() { + static int *i; + { + struct Y { + static void g() { + i = new int(); + *i = 100; + (*i) = (*i) +1; + } + }; + (void)Y::g(); + } + (void)i; +} |