diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-07-01 19:46:12 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-07-01 19:46:12 +0000 |
commit | cd1c0555286ff5aec940802f27a46fd1bae8aee7 (patch) | |
tree | 8f6710ea14d2afb67546b41113b8930925f18fff /clang/lib/Sema/SemaDecl.cpp | |
parent | 5a33687da07cb8ffc68ef5065ed46bab5c4d6555 (diff) | |
download | bcm5719-llvm-cd1c0555286ff5aec940802f27a46fd1bae8aee7.tar.gz bcm5719-llvm-cd1c0555286ff5aec940802f27a46fd1bae8aee7.zip |
Fix AST representations of alias-declarations which define tag types. Inside classes, the tag types need to have an associated access specifier, and inside function definitions, they need to be included in the declarations of the DeclStmt. These issues manifested as assertions during template instantiation, and also in a WIP constexpr patch.
llvm-svn: 134250
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 8069eb43859..ad1a62eb7fc 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -45,7 +45,12 @@ using namespace clang; using namespace sema; -Sema::DeclGroupPtrTy Sema::ConvertDeclToDeclGroup(Decl *Ptr) { +Sema::DeclGroupPtrTy Sema::ConvertDeclToDeclGroup(Decl *Ptr, Decl *OwnedType) { + if (OwnedType) { + Decl *Group[2] = { OwnedType, Ptr }; + return DeclGroupPtrTy::make(DeclGroupRef::Create(Context, Group, 2)); + } + return DeclGroupPtrTy::make(DeclGroupRef(Ptr)); } |