[llvm-bugs] [Bug 24904] clang cannot instantiate non-type template argument with static constexpr member function called via this->

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 5 17:55:33 PST 2017


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

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

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

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
C++ [expr.const]p2:

"A conditional-expression e is a core constant expression unless the evaluation
of e, following the rules of the abstract machine (1.9), would evaluate one of
the following expressions:
(2.1)
 — this (5.1.2), except in a constexpr function or a constexpr constructor that
is being evaluated as part of e;"

So while "B::b()" is a constant expression, "this->b()" is not; clang is
correct to reject this.

-- 
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/20170106/83c090cb/attachment.html>


More information about the llvm-bugs mailing list