cplusplus / cplusplus/draft

[namespace.udecl]/14 clarify wording for comparisons between templates and non-templates

Open
#3,543 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cwg
Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

[namespace.udecl]/14 "... member functions and member function templates in the derived class override and/or hide member functions and member function templates ..."

We recently ran into a bug where we had this code:

template <typename>
struct Result { };

struct Base {
  template <typename T>
  Result<T> f(int) const;

  virtual Result<int> f(int) const = 0;
};

struct Derived : Base {
  virtual Result<int> f(int) const final;
  using Base::f;
};

struct S { };

void f() {
    Derived d;
    d.f<S>(0);
}

And I found wording of [namespace.udecl]/14 to be insufficient in distinguishing that we need to compare member functions and member function templates respectively. @GabrielDosReis had to help guide me to the correct interpretation.

Can this be addressed editorially?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading [namespace.udecl]/14 and the example in this issue, focusing on the distinction between member functions and member function templates. Revise the wording so the two categories are compared respectively, then verify that the example's lookup and hiding behavior is unambiguous in the resulting text.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, tex
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.