Skip to content
Snippets Groups Projects
  • Nico Weber's avatar
    c04fe08b
    If a function decl cannot be merged, mark it as invalid. · c04fe08b
    Nico Weber authored
    Clang currently crashes on
    
        class C {
          C() = default;
          C() = delete;
        };
    
    My cunning plan for fixing this was to change the `if (!FnD)` in
    Parser::ParseCXXInlineMethodDef() to `if (!FnD || FnD->isInvalidDecl)` – but
    alas, the second constructor decl wasn't marked as invalid.  This lets
    Sema::MergeFunctionDecl() return true on function redeclarations, which leads
    to them being marked invalid.
    
    This also improves error messages when functions are redeclared.
    
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226365 91177308-0d34-0410-b5e6-96231b3b80d8
    c04fe08b
    History
    If a function decl cannot be merged, mark it as invalid.
    Nico Weber authored
    Clang currently crashes on
    
        class C {
          C() = default;
          C() = delete;
        };
    
    My cunning plan for fixing this was to change the `if (!FnD)` in
    Parser::ParseCXXInlineMethodDef() to `if (!FnD || FnD->isInvalidDecl)` – but
    alas, the second constructor decl wasn't marked as invalid.  This lets
    Sema::MergeFunctionDecl() return true on function redeclarations, which leads
    to them being marked invalid.
    
    This also improves error messages when functions are redeclared.
    
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226365 91177308-0d34-0410-b5e6-96231b3b80d8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.