[GRASS-dev] [GRASS GIS] #2871: lib/iostream/mm.cpp:Fails to build with GCC 6: declaration of ... has a different exception specifier

GRASS GIS trac at osgeo.org
Thu Jun 30 12:20:47 PDT 2016


#2871: lib/iostream/mm.cpp:Fails to build with GCC 6: declaration of ... has a
different exception specifier
------------------------+---------------------------------
  Reporter:  sebastic   |      Owner:  grass-dev@…
      Type:  defect     |     Status:  new
  Priority:  blocker    |  Milestone:  7.2.0
 Component:  Compiling  |    Version:  svn-releasebranch70
Resolution:             |   Keywords:  iostream
       CPU:  All        |   Platform:  Linux
------------------------+---------------------------------

Comment (by wenzeslaus):

 In [changeset:"68818" 68818]:
 {{{
 #!CommitTicketReference repository="" revision="68818"
 use exception specifiers only for C++ versions older than C++11

 Tested using GCC 5.2.1.

 No exception specifiers (throw(...)) fail with -std=c++98 -fexceptions.
 Omitting noexcept (or throw()) fails with -std=c++11 and -std=c++14.

 Using __cplusplus to get C++ standard version which defines
 how the definitions in the standard library look like
 and using GRASS_MM_USE_EXCEPTION_SPECIFIER we then use the right ones.

 This contains old fix for -fexceptions with GCC 4.7 (see #1533, r50130)
 and new fix for GCC 6 where -std=gnu++14 is by default (see #2871
 and Debian Bug 811886).

 Works also with clang++ -std=c++14.
 }}}

--
Ticket URL: </ticket/2871#comment:15>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list