[LLVMbugs] [Bug 18544] New: crash declaring inline operator new in a namespace

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jan 19 01:20:08 PST 2014


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

            Bug ID: 18544
           Summary: crash declaring inline operator new in a namespace
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nlewycky at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

nlewycky at ducttape:~/delta-2006.08.03$ cat 166.c
namespace ns {
  inline void* operator new(int size);
}
nlewycky at ducttape:~/delta-2006.08.03$ ~/llvm/Debug+Asserts/bin/clang -x c++
166.c -std=gnu++11
clang: Decl.cpp:2339: bool
clang::FunctionDecl::isReplaceableGlobalAllocationFunction() const: Assertion
`getDeclContext()->getRedeclContext()->isTranslationUnit()' failed.
0  clang           0x00000000033fea9f llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1  clang           0x00000000033fed1c
2  clang           0x00000000033fe785
3  libpthread.so.0 0x00007f0b63782cb0
4  libc.so.6       0x00007f0b62aba425 gsignal + 53
5  libc.so.6       0x00007f0b62abdb8b abort + 379
6  libc.so.6       0x00007f0b62ab30ee
7  libc.so.6       0x00007f0b62ab3192
8  clang           0x00000000020840d4
clang::FunctionDecl::isReplaceableGlobalAllocationFunction() const + 424
9  clang           0x00000000012d5f73
clang::Sema::ActOnFunctionDeclarator(clang::Scope*, clang::Declarator&,
clang::DeclContext*, clang::TypeSourceInfo*, clang::LookupResult&,
llvm::MutableArrayRef<clang::TemplateParameterList*>, bool&) + 8477
10 clang           0x00000000012cc200
clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&,
llvm::MutableArrayRef<clang::TemplateParameterList*>) + 2792
11 clang           0x00000000012caee2
clang::Sema::ActOnDeclarator(clang::Scope*, clang::Declarator&) + 80
12 clang           0x000000000119ea68
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&) + 134
13 clang           0x000000000119e493
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 1399
14 clang           0x000000000118bbd8
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 1220
15 clang           0x000000000118bcbc
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 174
16 clang           0x000000000118b3dc
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2686
17 clang           0x00000000011aff19
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
18 clang           0x00000000011afd80 clang::Parser::ParseNamespace(unsigned
int, clang::SourceLocation&, clang::SourceLocation) + 3396
19 clang           0x000000000119d617
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 541
20 clang           0x000000000118afc3
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 1637
21 clang           0x000000000118a913
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 535
22 clang           0x0000000001182eff clang::ParseAST(clang::Sema&, bool, bool)
+ 396
23 clang           0x0000000000d0c46a clang::ASTFrontendAction::ExecuteAction()
+ 322
24 clang           0x0000000000f76f8b clang::CodeGenAction::ExecuteAction() +
1291
25 clang           0x0000000000d0bf9d clang::FrontendAction::Execute() + 205
26 clang           0x0000000000ce060c
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 720
27 clang           0x0000000000cad1a4
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1074
28 clang           0x0000000000c9eb95 cc1_main(char const**, char const**, char
const*, void*) + 636
29 clang           0x0000000000ca8cb4 main + 770
30 libc.so.6       0x00007f0b62aa576d __libc_start_main + 237
31 clang           0x0000000000c9d269
Stack dump:
0.    Program arguments:
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
166.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.23.52.20130808 -resource-dir
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/../lib/clang/3.5
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/x86_64-linux-gnu/c++/4.6
-internal-isystem /usr/local/include -internal-isystem
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/../lib/clang/3.5/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-std=gnu++11 -fdeprecated-macro -fdebug-compilation-dir
/usr/local/google/home/nlewycky/delta-2006.08.03 -ferror-limit 19
-fmessage-length 204 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o
/tmp/166-6d9d43.o -x c++ 166.c 
1.    166.c:2:38: current parser token ';'
2.    166.c:1:1: parsing namespace 'ns'
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5 (trunk 199573) (llvm/trunk 192017:199573M)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/166-32f725.cpp
clang: note: diagnostic msg: /tmp/166-32f725.sh
clang: note: diagnostic msg: 

********************

-- 
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/20140119/518f7e28/attachment.html>


More information about the llvm-bugs mailing list