[LLVMbugs] [Bug 16423] New: clang crashes if one class defines another classes member using a friend *definition*

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jun 22 19:06:51 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16423

            Bug ID: 16423
           Summary: clang crashes if one class defines another classes
                    member using a friend *definition*
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

namespace dr136 { // dr136: no
  class C {};
  struct A {
    friend void C::f(int, int, int) {}
  };
}

llvm/src/include/llvm/Support/Casting.h:97: static bool llvm::isa_impl_cl<To,
const From*>::doit(const From*) [with To = clang::FunctionDecl, From =
clang::Decl]: Assertion `Val && "isa<> used on a null pointer"' failed.
0  clang++         0x0000000001df2f9d llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1  clang++         0x0000000001df3224
2  clang++         0x0000000001df2c68
3  libpthread.so.0 0x00007f0e7e34fcb0
4  libc.so.6       0x00007f0e7d7a5425 gsignal + 53
5  libc.so.6       0x00007f0e7d7a8b8b abort + 379
6  libc.so.6       0x00007f0e7d79e0ee
7  libc.so.6       0x00007f0e7d79e192
8  clang++         0x0000000001e4651f
9  clang++         0x0000000001e4473c
10 clang++         0x0000000001e94163
11 clang++         0x0000000001e8ed55 bool llvm::isa<clang::FunctionDecl,
clang::Decl*>(clang::Decl* const&) + 24
12 clang++         0x0000000001f0bddf
llvm::enable_if<llvm::is_same<clang::Decl,
llvm::simplify_type<clang::Decl>::SimpleType>,
llvm::cast_retty<clang::FunctionDecl, clang::Decl*>::ret_type>::type
llvm::dyn_cast<clang::FunctionDecl, clang::Decl>(clang::Decl*) + 24
13 clang++         0x000000000224e030
14 clang++         0x000000000224eacb
clang::Parser::ParseCXXInlineMethodDef(clang::AccessSpecifier,
clang::AttributeList*, clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::VirtSpecifiers const&,
clang::FunctionDefinitionKind, clang::ActionResult<clang::Expr*, true>&) + 2675
15 clang++         0x0000000002205da2
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 3858
16 clang++         0x0000000002207ab9
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 2901
17 clang++         0x0000000002204071
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 8171
18 clang++         0x00000000021efaed
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 8343
19 clang++         0x00000000021d9a57
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 101
20 clang++         0x00000000021d9ef1
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 189
21 clang++         0x00000000021d96a5
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2783
22 clang++         0x00000000021febef
clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, std::vector<clang::IdentifierInfo*,
std::allocator<clang::IdentifierInfo*> >&, std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&,
clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) + 193
23 clang++         0x00000000021fea5d clang::Parser::ParseNamespace(unsigned
int, clang::SourceLocation&, clang::SourceLocation) + 3253
24 clang++         0x00000000021ea7fb
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 545
25 clang++         0x00000000021d9256
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 1680
26 clang++         0x00000000021d8b95
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 415
27 clang++         0x00000000021d529b clang::ParseAST(clang::Sema&, bool, bool)
+ 387
28 clang++         0x00000000020d7802 clang::ASTFrontendAction::ExecuteAction()
+ 298
29 clang++         0x00000000020d7358 clang::FrontendAction::Execute() + 200
30 clang++         0x00000000020b00dc
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 720
31 clang++         0x0000000001df7ef8
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1018
32 clang++         0x0000000000d51ba4 cc1_main(char const**, char const**, char
const*, void*) + 717
33 clang++         0x0000000000d4b667 main + 496
34 libc.so.6       0x00007f0e7d79076d __libc_start_main + 237
35 clang++         0x0000000000d49df9

-- 
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/20130623/a54184d7/attachment.html>


More information about the llvm-bugs mailing list