Fix a bug that crashed clang when parsing this:
commit1f0d4c225fdc5b669bd6c6431e94efa5445c279e
authorArgiris Kirtzidis <akyrtzi@gmail.com>
Wed, 8 Oct 2008 22:20:31 +0000 (8 22:20 +0000)
committerArgiris Kirtzidis <akyrtzi@gmail.com>
Wed, 8 Oct 2008 22:20:31 +0000 (8 22:20 +0000)
tree3a84603092a448a9b7c40d5a265c15b3d8e7aa44
parent95029d906b78b22b378693dbfca6c2b65af0b36f
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57313 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDeclCXX.cpp
test/SemaCXX/class.cpp