Bug 2336713 - meshlab fails to build with GCC 15 (C++ "different exception specifier")
Summary: meshlab fails to build with GCC 15 (C++ "different exception specifier")
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: gcc-15-mass-prebuild
TreeView+ depends on / blocked
 
Reported: 2025-01-09 19:27 UTC by Dave Malcolm
Modified: 2025-01-17 14:11 UTC (History)
16 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-01-17 14:11:08 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dave Malcolm 2025-01-09 19:27:22 UTC
I'm experimentally rebuilding rawhide with the not-yet-released GCC 15 to see if anything breaks, and to help write the porting guide.  See https://fedoraproject.org/wiki/User:Dmalcolm/gcc-15

My test build with GCC 15 failed:
https://copr.fedorainfracloud.org/coprs/dmalcolm/gcc-15-smoketest-3.failed/build/8476742/

whereas my test build with GCC 14 succeeded:
https://copr.fedorainfracloud.org/coprs/dmalcolm/gcc-15-smoketest-3.failed.checker/build/8478970/

Looking at the failure logs e.g.
https://download.copr.fedorainfracloud.org/results/dmalcolm/gcc-15-smoketest-3.failed/fedora-rawhide-x86_64/08476742-meshlab/builder-live.log.gz
I see:

 11124 | /builddir/build/BUILD/meshlab-2023.12-build/meshlab-MeshLab-2023.12/src/external/downloads/u3d-1.5.1/RTL/IFXCorePluginStatic/IFXCorePluginStatic.cpp:141:9: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
 11125 |   141 |         throw(std::bad_alloc)
 11126 |       |         ^~~~~
>11127 | /builddir/build/BUILD/meshlab-2023.12-build/meshlab-MeshLab-2023.12/src/external/downloads/u3d-1.5.1/RTL/IFXCorePluginStatic/IFXCorePluginStatic.cpp:139:7: error: declaration of 'void* operator new(size_t) throw (std::bad_alloc)' has a different exception specifier
 11128 |   139 | void* operator new( size_t byteCount )
 11129 |       |       ^~~~~~~~
 11130 | In file included from /builddir/build/BUILD/meshlab-2023.12-build/meshlab-MeshLab-2023.12/src/external/downloads/u3d-1.5.1/RTL/IFXCorePluginStatic/IFXCorePluginStatic.cpp:34:
 11131 | /usr/include/c++/15/new:137:26: note: from previous declaration 'void* operator new(std::size_t)'
 11132 |   137 | _GLIBCXX_NODISCARD void* operator new(std::size_t)
 11133 |       |                          ^~~~~~~~

I'm wondering if something changed in g++ or C++ stdlib.

Reproducible: Didn't try

Comment 1 Jonathan Wakely 2025-01-09 19:29:51 UTC
Minimised reproducer, using -std=c++11:

#include <new>
void *operator new(std::size_t x) throw(std::bad_alloc);

Comment 2 Jonathan Wakely 2025-01-09 19:31:59 UTC
Jason suggested it probably started to be rejected with https://gcc.gnu.org/r15-3532-g7cebc6384a0ad6 which seems likely.

It might make sense to relax the error to a warning for the specific case of definitions of operator new, because in C++98 it was required to declare them as throw(std::bad_alloc).

Comment 3 Jason Merrill 2025-01-09 21:32:05 UTC
r15-6751-gfab96de044f1f0 should fix this.

Comment 4 Jonathan Wakely 2025-01-09 23:25:21 UTC
Looks like it was actually the previous commit, r15-6750-g3cae3a80695e5a

Comment 5 Miro Hrončok 2025-01-10 10:13:03 UTC
I am a tad confused. Do we need to fix mashlab, or do you use this a forum to discuss changes in gcc, and will eventually turn this into NOTABUG?

Comment 6 Miro Hrončok 2025-01-10 10:13:30 UTC
...use this as a forum...

Comment 7 Jonathan Wakely 2025-01-10 10:25:18 UTC
Dave is filing FTBFS bugs for test rebuilds with GCC 15. Most of them are package bugs that should be fixed. In this case the package does contain code that is technically invalid in current C++ standards, but GCC has been relaxed to allow it with a warning. So this one will probably get closed as NOTABUG.

Comment 8 Siddhesh Poyarekar 2025-01-17 14:09:55 UTC
Moving this to gcc since the gcc bug seems to have been fixed. I'm filing a separate bug for the failures I'm currently seeing now, since they're meshlab bugs.


Note You need to log in before you can comment on or make changes to this bug.