[all-commits] [llvm/llvm-project] db93ef: [Clang] Implement CWG2813: Class member access wit...

cor3ntin via All-commits all-commits at lists.llvm.org
Wed Dec 18 01:45:05 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: db93ef14aef9c572e02bc842762bc4d0278148f9
      https://github.com/llvm/llvm-project/commit/db93ef14aef9c572e02bc842762bc4d0278148f9
  Author: cor3ntin <corentinjabot at gmail.com>
  Date:   2024-12-18 (Wed, 18 Dec 2024)

  Changed paths:
    M clang-tools-extra/clangd/unittests/DumpASTTests.cpp
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/Expr.cpp
    M clang/lib/Sema/SemaExprMember.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/lib/Sema/SemaStmt.cpp
    M clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.nodiscard/p2.cpp
    M clang/test/CXX/drs/cwg28xx.cpp
    M clang/test/CodeGenCXX/cxx2b-deducing-this.cpp
    M clang/test/SemaCXX/cxx2b-deducing-this.cpp
    M clang/test/SemaCXX/ms-property.cpp
    M clang/www/cxx_dr_status.html

  Log Message:
  -----------
  [Clang] Implement CWG2813: Class member access with prvalues (#120223)

This is a rebase of #95112 with my own feedback apply as @MitalAshok has
been inactive for a while.
It's fairly important this makes clang 20 as it is a blocker for #107451

--- 

[CWG2813](https://cplusplus.github.io/CWG/issues/2813.html)

prvalue.member_fn(expression-list) now will not materialize a temporary
for prvalue if member_fn is an explicit object member function, and
prvalue will bind directly to the object parameter.

The E1 in E1.static_member is now a discarded-value expression, so if E1
was a call to a [[nodiscard]] function, there will now be a warning.
This also affects C++98 with [[gnu::warn_unused_result]] functions.

This should not affect C where TemporaryMaterializationConversion is a
no-op.

Closes #100314
Fixes #100341

---------

Co-authored-by: Mital Ashok <mital at mitalashok.co.uk>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list