Fix crash generating debug info for constructor for anonymous struct.
llvm-svn: 93601
This commit is contained in:
parent
97598f0cba
commit
8fdc2cb46a
|
@ -1001,7 +1001,7 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType,
|
|||
const Decl *D = GD.getDecl();
|
||||
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
|
||||
Name = getFunctionName(FD);
|
||||
if (Name[0] == '\01')
|
||||
if (!Name.empty() && Name[0] == '\01')
|
||||
Name = Name.substr(1);
|
||||
// Use mangled name as linkage name for c/c++ functions.
|
||||
LinkageName = CGM.getMangledName(GD);
|
||||
|
|
|
@ -18,3 +18,9 @@ void f() {
|
|||
int B::*a = 0;
|
||||
void (B::*b)() = 0;
|
||||
}
|
||||
|
||||
namespace EmptyNameCrash {
|
||||
struct A { A(); };
|
||||
typedef struct { A x; } B;
|
||||
B x;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue