[Bug preprocessor/106272] clang build: new warning ?

2022-07-13 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106272

--- Comment #9 from David Malcolm  ---
Thanks!

[Bug preprocessor/106272] clang build: new warning ?

2022-07-13 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106272

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Marek Polacek  ---
Fixed.

[Bug preprocessor/106272] clang build: new warning ?

2022-07-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106272

--- Comment #7 from CVS Commits  ---
The trunk branch has been updated by Marek Polacek :

https://gcc.gnu.org/g:86a15b266a7284f3aa1b12494a475f31416b981d

commit r13-1689-g86a15b266a7284f3aa1b12494a475f31416b981d
Author: Marek Polacek 
Date:   Tue Jul 12 20:18:56 2022 -0400

libcpp: Avoid pessimizing std::move [PR106272]

std::move in a return statement can prevent the NRVO:
   


PR106272 reports that we have two such cases in class label_text's
member functions.  We have -Wpessimizing-move that's supposed to detect
problematic std::move uses, but in this case it didn't trigger.  I've filed
PR106276 to track that.

PR preprocessor/106272

libcpp/ChangeLog:

* include/line-map.h (class label_text): Don't std::move in a
return
statement.

[Bug preprocessor/106272] clang build: new warning ?

2022-07-12 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106272

Marek Polacek  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=106276

--- Comment #6 from Marek Polacek  ---
(In reply to Marek Polacek from comment #4)
> (In reply to Eric Gallager from comment #3)
> > Note that GCC has its own version of -Wpessimizing-move, too... any idea why
> > clang's version of the flag catches it, but gcc's doesn't?
> 
> No, but I'm going to reduce libcpp/line-map.ii to create a testcase and file
> a bug and since it's my warning, maybe even fix it.

Bug 106276.

[Bug preprocessor/106272] clang build: new warning ?

2022-07-12 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106272

Marek Polacek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

--- Comment #5 from Marek Polacek  ---
And while at it, why don't I fix this one.

[Bug preprocessor/106272] clang build: new warning ?

2022-07-12 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106272

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #4 from Marek Polacek  ---
(In reply to Eric Gallager from comment #3)
> Note that GCC has its own version of -Wpessimizing-move, too... any idea why
> clang's version of the flag catches it, but gcc's doesn't?

No, but I'm going to reduce libcpp/line-map.ii to create a testcase and file a
bug and since it's my warning, maybe even fix it.

[Bug preprocessor/106272] clang build: new warning ?

2022-07-12 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106272

Eric Gallager  changed:

   What|Removed |Added

   Keywords||build, diagnostic
 CC||egallager at gcc dot gnu.org

--- Comment #3 from Eric Gallager  ---
Note that GCC has its own version of -Wpessimizing-move, too... any idea why
clang's version of the flag catches it, but gcc's doesn't?

[Bug preprocessor/106272] clang build: new warning ?

2022-07-12 Thread dcb314 at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106272

--- Comment #2 from David Binderman  ---
I just noticed similar four lines earlier:

libcpp/include/line-map.h:1876:12: warning: moving a temporary object prevents
copy elision [-Wpessimizing-move]

Source code is

return std::move (label_text (const_cast  (buffer), false));

About 700 mentions of this one, as well.

[Bug preprocessor/106272] clang build: new warning ?

2022-07-12 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106272

Jonathan Wakely  changed:

   What|Removed |Added

   Last reconfirmed||2022-07-12
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #1 from Jonathan Wakely  ---
(In reply to David Binderman from comment #0)
> This new warning appears about 700 times, so it might be important.

It's not. But the move is useless and shouldn't be there.