[cfe-dev] r128208 fixes PR9463 for real, but breaks other part :-(

Jean-Daniel Dupas devlists at shadowlab.org
Thu Mar 24 07:59:41 PDT 2011


Look like clang no longer like label with the same name than an existing function:

------ AudioStream.cpp

extern "C" void exit(int) __attribute__((__noreturn__));

class CAStreamBasicDescription  {
public:
  char * AsString(char *buf) const {
    char *theBuffer = buf;
    if (buf <= 0) goto exit;    
  exit:
    return 0;
  }
};

---------------------------

$ clang++ -fsyntax-only AudioStream.cpp 

Assertion failed: (LabelAndGotoScopes.count(To) && "Jump didn't get added to scopes?"), function CheckJump, file /Volumes/MacPro/Projects/OpenSource/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp, line 541.
0  clang             0x0000000100f50672 PrintStackTrace(void*) + 34
[…]
7  clang             0x000000010026ed8d clang::Sema::DiagnoseInvalidJumps(clang::Stmt*) + 317
8  clang             0x00000001002fb8ba clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) + 762
9  clang             0x000000010025842b clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) + 235
[…]
Stack dump:
0.	Program arguments: /Volumes/MacPro/Projects/OpenSource/llvm/release/Release+Asserts/bin/clang -cc1 -triple x86_64-apple-darwin10.0.0 -fsyntax-only -disable-free -main-file-name AudioStream.cpp -pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 97.17 -resource-dir /Volumes/MacPro/Projects/OpenSource/llvm/release/Release+Asserts/bin/../lib/clang/3.0 -ferror-limit 19 -fmessage-length 180 -stack-protector 1 -fblocks -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -x c++ AudioStream.cpp 
1.	AudioStream.cpp:12:2: current parser token ';'
2.	AudioStream.cpp:4:1: parsing struct/union/class body 'CAStreamBasicDescription'
3.	AudioStream.cpp:6:36: parsing function body 'AsString'
clang: error: unable to execute command: Illegal instruction
clang: error: clang frontend command failed due to signal 1 (use -v to see invocation)


-- Jean-Daniel




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110324/a32c46d4/attachment.html>


More information about the cfe-dev mailing list