Skip to content
Snippets Groups Projects
  • Serge Pavlov's avatar
    ff4214dd
    Do not inherit default arguments for friend function in class template. · ff4214dd
    Serge Pavlov authored
    A function declared in a friend declaration may have declarations prior
    to the containing class definition. If such declaration defines default
    argument, the friend function declaration inherits them. This behavior
    causes problems if the class where the friend is declared is a template:
    during the class instantiation the friend function looks like if it had
    default arguments, so error is triggered.
    
    With this change friend functions declared in class templates do not
    inherit default arguments. Actual set of them will be defined at the
    point where the containing class is instantiated.
    
    This change fixes PR12724.
    
    Differential Revision: https://reviews.llvm.org/D30393
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304965 91177308-0d34-0410-b5e6-96231b3b80d8
    ff4214dd
    History
    Do not inherit default arguments for friend function in class template.
    Serge Pavlov authored
    A function declared in a friend declaration may have declarations prior
    to the containing class definition. If such declaration defines default
    argument, the friend function declaration inherits them. This behavior
    causes problems if the class where the friend is declared is a template:
    during the class instantiation the friend function looks like if it had
    default arguments, so error is triggered.
    
    With this change friend functions declared in class templates do not
    inherit default arguments. Actual set of them will be defined at the
    point where the containing class is instantiated.
    
    This change fixes PR12724.
    
    Differential Revision: https://reviews.llvm.org/D30393
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304965 91177308-0d34-0410-b5e6-96231b3b80d8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.