[llvm-bugs] [Bug 30400] Inheriting constructor resolving incorrectly.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 15 11:38:36 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30400

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |DUPLICATE

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Note that Clang 3.9 implements
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0136r1.html and the
other cited compilers do not.

Under p0136r1, inheriting a constructor works much more like inheriting any
other member function. Note that this is rejected by all referenced compilers:

struct R {
  void f() noexcept;
};

struct S : R {
  using R::f;
  template<class = void>
  void f();
};

static_assert(!noexcept(S{}.f()), "");

So, this is working correctly per the standard + current DRs. Whether or not
that *should* work is a separate question, but it seems sensible to me that the
behavior be the same for constructors and other member functions. (We could
certainly imagine changing the rules for using-declarations so that a function
from a derived class is considered better than one from a base class, before
the template/non-template tiebreaker.)

Resolving as a duplicate of PR30305, as this is another "Implementing p0136r1
changes meaning of existing code" issue.

*** This bug has been marked as a duplicate of bug 30305 ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160915/a6a4ada9/attachment.html>


More information about the llvm-bugs mailing list