Title
Lookup in member function declarations
Status
open
Section
6.4.1 [basic.lookup.unqual]
Submitter
John Spicer

Created on 2017-09-07.00:00:00, last changed 2017-09-07.00:00:00.

Messages

Date: 2017-09-07.00:00:00

Consider an example like the following:

  template <typename T>
  void doit(const T& t, const T& t2) { }

  template <typename T>
  struct Container {
    auto doit(Container<T> &rhs)
    noexcept(noexcept(doit(T{}, T{})))
       -> decltype(doit(T{}, T{}));
  };

  Container<int> c; 

This would appear to be ill-formed because the exception specification is a delayed-parse region, where the lookup is in the context of the completed class, while the lookup in the decltype in the return type is done immediately. The latter should find the two-parameter version of doit, as expected, while the former finds the member, one-parameter version. Current implementations accept the code, however, and it seems unfortunate that the meaning would be different in the two contexts.

History
Date User Action Args
2017-09-07 00:00:00admincreate