[llvm-branch-commits] [cfe-branch] r323108 - Merging r322984:
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Jan 22 04:54:40 PST 2018
Author: hans
Date: Mon Jan 22 04:54:39 2018
New Revision: 323108
URL: http://llvm.org/viewvc/llvm-project?rev=323108&view=rev
Log:
Merging r322984:
------------------------------------------------------------------------
r322984 | rtrieu | 2018-01-19 21:46:19 +0100 (Fri, 19 Jan 2018) | 7 lines
Allow BlockDecl in CXXRecord scope to have no access specifier.
Using a BlockDecl in a default member initializer causes it to be attached to
CXXMethodDecl without its access specifier being set. This prevents a crash
where getAccess is called on this BlockDecl, since that method expects any
Decl in CXXRecord scope to have an access specifier.
------------------------------------------------------------------------
Added:
cfe/branches/release_60/test/Modules/odr_hash-blocks.cpp
- copied unchanged from r322984, cfe/trunk/test/Modules/odr_hash-blocks.cpp
Modified:
cfe/branches/release_60/ (props changed)
cfe/branches/release_60/lib/AST/DeclBase.cpp
Propchange: cfe/branches/release_60/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 22 04:54:39 2018
@@ -1,4 +1,4 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:321754,321771,321777,321779,321933,322018,322236,322246,322350,322390,322405,322420,322518,322593,322901
+/cfe/trunk:321754,321771,321777,321779,321933,322018,322236,322246,322350,322390,322405,322420,322518,322593,322901,322984
/cfe/trunk/test:170344
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/release_60/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_60/lib/AST/DeclBase.cpp?rev=323108&r1=323107&r2=323108&view=diff
==============================================================================
--- cfe/branches/release_60/lib/AST/DeclBase.cpp (original)
+++ cfe/branches/release_60/lib/AST/DeclBase.cpp Mon Jan 22 04:54:39 2018
@@ -891,12 +891,14 @@ bool Decl::AccessDeclContextSanity() con
// 4. the context is not a record
// 5. it's invalid
// 6. it's a C++0x static_assert.
+ // 7. it's a block literal declaration
if (isa<TranslationUnitDecl>(this) ||
isa<TemplateTypeParmDecl>(this) ||
isa<NonTypeTemplateParmDecl>(this) ||
!isa<CXXRecordDecl>(getDeclContext()) ||
isInvalidDecl() ||
isa<StaticAssertDecl>(this) ||
+ isa<BlockDecl>(this) ||
// FIXME: a ParmVarDecl can have ClassTemplateSpecialization
// as DeclContext (?).
isa<ParmVarDecl>(this) ||
More information about the llvm-branch-commits
mailing list