Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#8725 closed Bugs (fixed)

GCC 4.8 warns of ignored attribute in declaration

Reported by: Chris Stylianou <chris5287@…> Owned by: Vladimir Prus
Milestone: Boost 1.54.0 Component: program_options
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

When compiling with -Wall (GCC 4.8.0) the following warning is raised as an error:

In file included from libs/program_options/src/variables_map.cpp:12:0:
./boost/program_options/variables_map.hpp:30:11: error: attribute ignored in declaration of ‘class boost::program_options::variables_map’ [-Werror=attributes]
     class variables_map;
           ^
./boost/program_options/variables_map.hpp:30:11: note: attribute for ‘class boost::program_options::variables_map’ must follow the ‘class’ keyword

This is caused by friend class declaration below having the attributes in the wrong order. Below is the simple fix.

Index: boost/program_options/variables_map.hpp
===================================================================
--- boost/program_options/variables_map.hpp     (revision 84899)
+++ boost/program_options/variables_map.hpp     (working copy)
@@ -98,7 +98,7 @@
         void store(const basic_parsed_options<char>& options, 
               variables_map& m, bool);
 
-        friend BOOST_PROGRAM_OPTIONS_DECL class variables_map;
+        friend class BOOST_PROGRAM_OPTIONS_DECL variables_map;
     };
 
     /** Implements string->string mapping with convenient value casting

Attachments (1)

patch-8725.txt (577 bytes ) - added by Chris Stylianou <chris5287@…> 9 years ago.

Download all attachments as: .zip

Change History (3)

by Chris Stylianou <chris5287@…>, 9 years ago

Attachment: patch-8725.txt added

comment:1 by Vladimir Prus, 9 years ago

Resolution: fixed
Status: newclosed

(In [84903]) Silence gcc warning. Thanks to Chris Stylianou.

Closes #8725.

comment:2 by Chris Stylianou <chris5287@…>, 9 years ago

Will this be merged into release for 1.55?

Note: See TracTickets for help on using tickets.