[llvm-bugs] [Bug 51399] Failed to compile expression with constant operator=()

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 18 12:45:07 PDT 2021


Aaron Ballman <aaron at aaronballman.com> changed:

           What    |Removed                     |Added
         Resolution|---                         |WONTFIX
             Status|NEW                         |RESOLVED
                 CC|                            |aaron at aaronballman.com

--- Comment #1 from Aaron Ballman <aaron at aaronballman.com> ---
My reading of the standard says that Clang is correct to diagnose here. Given
the declaration:
field_t<name="degrees"> degrees;
This is a simple-declaration whose only decl-specifier is comprised of
simple-type-specifier which is eventually a simple-template-id
(http://eel.is/c++draft/temp.names#nt:simple-template-id). The
template-argument (http://eel.is/c++draft/temp.names#nt:template-argument) for
simple-template-id is not a valid constant-expression because of precedence
rules (http://eel.is/c++draft/expr.const#nt:constant-expression).

I believe that wrapping the expression in parentheses is the correct way to
work around the precedence issue.

Closing as WONTFIX because this appears to be behaving according to
specification. However, if you think my analysis here is incorrect, please
reopen the bug with more details.

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/20211018/5ab0765c/attachment.html>

More information about the llvm-bugs mailing list