Skip to content

assertion failure with C++ namespaces #2647

@tkremenek

Description

@tkremenek
mannequin
Bugzilla Link 2275
Resolution FIXED
Resolved on Nov 07, 2018 00:22
Version unspecified
OS All
CC @tkremenek

Extended Description

The semantic analyzer crashes on the following input (also attached):

long long f(long long);

namespace __gnu_cxx {
inline long long f(long long __x) {}
}

What we see:

$ clang t.cpp

Assertion failed: (( (isa(DC) && isa(CurContext)) || DC->getParent() == CurContext ) && "The next DeclContext should be directly contained in the current one."), function PushDeclContext, file SemaDecl.cpp, line 48.
0 clang 0x0029b785 ZNK4llvm3sys4PathneERKS1 + 79
1 clang 0x0029b981 _ZN4llvm3sys28PrintStackTraceOnErrorSignalEv + 387
2 libSystem.B.dylib 0x948dd5eb _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 libSystem.B.dylib 0x949563f2 raise + 26
5 libSystem.B.dylib 0x949659af abort + 73
6 libSystem.B.dylib 0x94957593 __assert_rtn + 101
7 clang 0x000e3f7f _ZN5clang4Sema15PushDeclContextEPNS_11DeclContextE + 135
8 clang 0x000e43de _ZN5clang4Sema23ActOnStartOfFunctionDefEPNS_5ScopeERNS_10DeclaratorE + 1104
9 clang 0x00174f45 _ZN5clang6Parser23ParseFunctionDefinitionERNS_10DeclaratorE + 505
10 clang 0x001754ab _ZN5clang6Parser36ParseDeclarationOrFunctionDefinitionEv + 1333
11 clang 0x00175605 _ZN5clang6Parser24ParseExternalDeclarationEv + 85
12 clang 0x0016441a _ZN5clang6Parser14ParseNamespaceEj + 406
13 clang 0x001629ba _ZN5clang6Parser16ParseDeclarationEj + 66
14 clang 0x001757d6 _ZN5clang6Parser24ParseExternalDeclarationEv + 550
15 clang 0x00175823 _ZN5clang6Parser17ParseTopLevelDeclERPv + 61
16 clang 0x000d9247 _ZN5clang8ParseASTERNS_12PreprocessorEPNS_11ASTConsumerEb + 339
17 clang 0x000297d8 _Z16InitializeGCModeRN5clang11LangOptionsE + 5620
18 clang 0x0002c30b main + 1345
19 clang 0x00002356 start + 54

My version of clang:

(kremenek@grue:clang)$ svn info
Path: .
URL: https://kremenek@llvm.org/svn/llvm-project/cfe/trunk
Repository Root: https://kremenek@llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 50576
Node Kind: directory
Schedule: normal
Last Changed Author: kremenek
Last Changed Rev: 50557
Last Changed Date: 2008-05-01 16:38:35 -0700 (Thu, 01 May 2008)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions