[LLVMbugs] [Bug 6769] New: Codegen crashes emitting code for static member function of local class within a static member function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 2 11:00:12 PDT 2010


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

           Summary: Codegen crashes emitting code for static member
                    function of local class within a static member
                    function
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: chandlerc at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


% cat t.cc
struct X {
  static void f();
};

void X::f() {
  static int *i;
  {
    struct Y {
      static void g() {
        i = new int();
      }
    };
    (void)Y::g();
  }
  (void)i;
}

% ./bin/clang -c -emit-llvm t.cc
clang: /home/chandlerc/src/llvm/trunk/tools/clang/lib/CodeGen/CGExpr.cpp:1085:
clang::CodeGen::LValue clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(const
clang::DeclRefExpr*): Assertion `V && "DeclRefExpr not entered in
LocalDeclMap?"' failed.
Stack dump:
0.      Program arguments: /home/chandlerc/src/llvm/trunk/build/bin/clang -cc1
-triple x86_64-unknown-linux-gnu -emit-llvm-bc -disable-free -main-file-name
t.cc -mrelocation-model static -mdisable-fp-elim -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -resource-dir
/home/chandlerc/src/llvm/trunk/build/lib/clang/1.5 -fmessage-length 179
-fexceptions -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o t.o
-x c++ t.cc 
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      t.cc:9:19: Generating code for declaration 'X::f()::Y::g'
4.      t.cc:9:23: LLVM IR generation of compound statement ('{}')
clang: error: compiler command failed due to signal 6 (use -v to see
invocation)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list