Opened 5 years ago

Closed 5 years ago

#7752 closed Support Requests (fixed)

algorithm minmax_element triggers warning with Clang

Reported by: pbristow Owned by: marshall
Milestone: To Be Determined Component: algorithm
Version: Boost Development Trunk Severity: Optimization
Keywords: minmax_element warning clang Cc:


algorithm minmax_element triggers warning with Clang 3.1

if (comp(first, min_result))
  min_result = first, potential_min_result = last;

is flagged as having Cish comma abuse ;-)

Unless I'm missing something subtle, this can easily be avoided with the more C++ish?

if (comp(first, min_result))
  min_result = first;
  potential_min_result = last;

path attached.

(This does not show when compiling tests, but does show in user code. There are many duplicated warnings from Boost.Test that make it difficult to find other possibly helpful warnings. And hex_test1 aborted...).

Attachments (1)

algorithm_minmax_element (602 bytes) - added by pbristow 5 years ago.
Path to suppress warning

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by pbristow

Path to suppress warning

comment:1 Changed 5 years ago by marshall

(In [81876]) Removed use of comma operator; Refs #7752

comment:2 Changed 5 years ago by marshall

  • Resolution set to fixed
  • Status changed from new to closed

(In [82049]) merge bug fix for minmax_element to release; Fixes #7752

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain marshall.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.