diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-10-08 22:20:31 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-10-08 22:20:31 +0000 |
commit | 1207d3195276362a1dd9bfbefccd847bd557454a (patch) | |
tree | 294da4dd7312b3c956dcef62c516e6b613fd28da /clang/test/SemaCXX/class.cpp | |
parent | d796164e89187d59c663e63ba30042a7f139477e (diff) | |
download | bcm5719-llvm-1207d3195276362a1dd9bfbefccd847bd557454a.tar.gz bcm5719-llvm-1207d3195276362a1dd9bfbefccd847bd557454a.zip |
Fix a bug that crashed clang when parsing this:
class C {
static const int number = 50;
static int arr[number];
};
Here's how it worked:
-GetTypeForDeclarator was called from both Sema::ActOnCXXMemberDeclarator and Sema::ActOnDeclarator.
-VariableArrayTypes are not uniqued so two VariableArrayTypes were created with the same DeclRefExpr.
-On exit they both tried to destroy that one DeclRefExpr.
The fix is not to use GetTypeForDeclarator from the Sema::ActOnCXXMemberDeclarator.
llvm-svn: 57313
Diffstat (limited to 'clang/test/SemaCXX/class.cpp')
-rw-r--r-- | clang/test/SemaCXX/class.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/class.cpp b/clang/test/SemaCXX/class.cpp index 1fbff69cb58..71ad7de9143 100644 --- a/clang/test/SemaCXX/class.cpp +++ b/clang/test/SemaCXX/class.cpp @@ -55,6 +55,9 @@ public: private: int x,y; static int sx; + + static const int number = 50; + static int arr[number]; }; class C2 { |