[LLVMbugs] [Bug 22055] New: Crash on invalid: Assertion failed: (Access == AS_private || Access == AS_protected)
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Dec 29 16:42:29 PST 2014
http://llvm.org/bugs/show_bug.cgi?id=22055
Bug ID: 22055
Summary: Crash on invalid: Assertion failed: (Access ==
AS_private || Access == AS_protected)
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: nicolasweber at gmx.de
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
Both member functions in the follow snippet cause asserts:
class BB {
template <class B {}, B> void f() {}
template <class C : C {}> void g() {}
};
$ bin/clang -c test2.cc -std=c++11
test2.cc:2:19: error: 'BB::B' cannot be defined in a type specifier
template <class B {}, B> void f() {}
^
test2.cc:2:23: error: a non-type template parameter cannot have type 'class B'
template <class B {}, B> void f() {}
^
test2.cc:2:26: error: a non-type template parameter cannot have type 'BB::B'
template <class B {}, B> void f() {}
^
Assertion failed: (Access == AS_private || Access == AS_protected), function
HasAccess, file /Users/thakis/src/llvm-rw/tools/clang/lib/Sema/SemaAccess.cpp,
line 737.
0 clang-3.5 0x000000010b53d0c9
llvm::sys::PrintStackTrace(__sFILE*) + 57
1 clang-3.5 0x000000010b53d84b SignalHandler(int) + 635
2 libsystem_platform.dylib 0x00007fff872f7f1a _sigtramp + 26
3 clang-3.5 0x000000010d293758 guard variable for
isAllowedIDChar(unsigned int, clang::LangOptions const&)::C99AllowedIDChars +
83360
4 clang-3.5 0x000000010b53d5b6 abort + 22
5 clang-3.5 0x000000010b53d591 __assert_rtn + 81
6 clang-3.5 0x000000010c0a79f2 HasAccess(clang::Sema&,
(anonymous namespace)::EffectiveContext const&, clang::CXXRecordDecl const*,
clang::AccessSpecifier, (anonymous namespace)::AccessTarget const&) + 1746
7 clang-3.5 0x000000010c0a704d IsAccessible(clang::Sema&,
(anonymous namespace)::EffectiveContext const&, (anonymous
namespace)::AccessTarget&) + 253
8 clang-3.5 0x000000010c0a3bb7
CheckEffectiveAccess(clang::Sema&, (anonymous namespace)::EffectiveContext
const&, clang::SourceLocation, (anonymous namespace)::AccessTarget&) + 71
9 clang-3.5 0x000000010c0a38c6
clang::Sema::HandleDelayedAccessCheck(clang::sema::DelayedDiagnostic&,
clang::Decl*) + 342
10 clang-3.5 0x000000010c195f20
clang::Sema::PopParsingDeclaration(clang::Sema::DelayedDiagnosticsState,
clang::Decl*) + 512
11 clang-3.5 0x000000010beae2b8
clang::Parser::ParseCXXInlineMethodDef(clang::AccessSpecifier,
clang::AttributeList*, clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::VirtSpecifiers const&,
clang::FunctionDefinitionKind, clang::ActionResult<clang::Expr*, true>&) + 600
12 clang-3.5 0x000000010bee0ee3
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 5571
13 clang-3.5 0x000000010bf359b5
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 165
14 clang-3.5 0x000000010bf355c8
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 1064
15 clang-3.5 0x000000010bf34f5a
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 282
16 clang-3.5 0x000000010bedfe84
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 1380
17 clang-3.5 0x000000010bedd2ff
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 3647
18 clang-3.5 0x000000010bedb9a3
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 9059
19 clang-3.5 0x000000010bebd568
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 3448
20 clang-3.5 0x000000010bf45189
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 73
21 clang-3.5 0x000000010bf44d67
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 375
22 clang-3.5 0x000000010bf43d06
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2710
23 clang-3.5 0x000000010bf43135
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 485
24 clang-3.5 0x000000010beadac7 clang::ParseAST(clang::Sema&,
bool, bool) + 247
25 clang-3.5 0x000000010bb02ffb
clang::CodeGenAction::ExecuteAction() + 123
26 clang-3.5 0x000000010b766183 clang::FrontendAction::Execute()
+ 67
27 clang-3.5 0x000000010b7379fc
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 972
28 clang-3.5 0x000000010b7a66f5
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 4149
29 clang-3.5 0x000000010a633a4c cc1_main(llvm::ArrayRef<char
const*>, char const*, void*) + 1068
30 clang-3.5 0x000000010a6326fe main + 11438
31 libdyld.dylib 0x00007fff8a2cf5c9 start + 1
The LookupResult tries to do an access check since it's a lookup for a class,
but both UnprivilegedAccess and FinalAccess in IsAccessible() in SemaAccess.cpp
end up being AS_none in this case.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141230/68ed4256/attachment.html>
More information about the llvm-bugs
mailing list