GNU bug report logs - #70935
Support C++17 compilers in the C++ tests

Previous Next

Package: libtool;

Reported by: Bruno Haible <bruno <at> clisp.org>

Date: Tue, 14 May 2024 12:06:01 UTC

Severity: normal

Done: Ileana Dumitrescu <ileanadumitrescu95 <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 70935 in the body.
You can then email your comments to 70935 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-libtool <at> gnu.org:
bug#70935; Package libtool. (Tue, 14 May 2024 12:06:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bruno Haible <bruno <at> clisp.org>:
New bug report received and forwarded. Copy sent to bug-libtool <at> gnu.org. (Tue, 14 May 2024 12:06:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bruno Haible <bruno <at> clisp.org>
To: bug-libtool <at> gnu.org
Subject: Support C++17 compilers in the C++ tests
Date: Tue, 14 May 2024 14:05:25 +0200
[Message part 1 (text/plain, inline)]
Hi,

Running the libtool tests on Ubuntu 22.04, I saw this test output:

  Constructors.

  142: C++ static constructors                         ok
  143: C++ exception handling                          skipped (exceptions.at:361)

It sounds odd that a C++ test gets skipped when a perfectly fine C++ compiler
is present. So I investigated...

The log file of the respective test is:

--------------------------------------------------------------------------------
#                             -*- compilation -*-
143. exceptions.at:24: testing C++ exception handling ...
./exceptions.at:33: case $LIBLTDL in #(
 */_inst/lib/*) test -f "$LIBLTDL" || (exit 77) ;;
esac
stdout:
./exceptions.at:361: $CXX $CPPFLAGS $CXXFLAGS -DUSING_COMMON_DLL -DUSING_MODULE_DLL -DUSING_LIB_DLL -c main.cpp || exit 77
stderr:
In file included from main.cpp:7:
lib.h:30:26: error: ISO C++17 does not allow dynamic exception specifications
   30 | int LIB_IMPEXP libfoo () throw (libexc);
      |                          ^~~~~
In file included from main.cpp:8:
module.h:17:40: error: ISO C++17 does not allow dynamic exception specifications
   17 | extern "C" int MODULE_IMPEXP modfoo () throw (modexc);
      |                                        ^~~~~
main.cpp:22:16: error: ISO C++17 does not allow dynamic exception specifications
   22 | int foo (void) throw (exc)
      |                ^~~~~
stdout:
143. exceptions.at:24: 143. C++ exception handling (exceptions.at:24): skipped (exceptions.at:361)
--------------------------------------------------------------------------------

The problem is apparently that the test uses old syntax that was deprecated
in C++11 and removed in C++17 [1]. The new syntax is described in [2].

The attached patch fixes it.

[1] https://en.cppreference.com/w/cpp/language/except_spec
[2] https://en.cppreference.com/w/cpp/language/noexcept_spec

[0001-Support-C-17-compilers-in-the-C-tests.patch (text/x-patch, attachment)]

Reply sent to Ileana Dumitrescu <ileanadumitrescu95 <at> gmail.com>:
You have taken responsibility. (Mon, 01 Jul 2024 15:57:02 GMT) Full text and rfc822 format available.

Notification sent to Bruno Haible <bruno <at> clisp.org>:
bug acknowledged by developer. (Mon, 01 Jul 2024 15:57:02 GMT) Full text and rfc822 format available.

Message #10 received at 70935-done <at> debbugs.gnu.org (full text, mbox):

From: Ileana Dumitrescu <ileanadumitrescu95 <at> gmail.com>
To: 70935-done <at> debbugs.gnu.org
Cc: Bruno Haible <bruno <at> clisp.org>
Subject: Re: bug#70935: Support C++17 compilers in the C++ tests
Date: Mon, 1 Jul 2024 18:55:32 +0300
[Message part 1 (text/plain, inline)]
On 14/05/2024 15:05, Bruno Haible wrote:
> Hi,
> 
> Running the libtool tests on Ubuntu 22.04, I saw this test output:
> 
>    Constructors.
> 
>    142: C++ static constructors                         ok
>    143: C++ exception handling                          skipped (exceptions.at:361)
> 
> It sounds odd that a C++ test gets skipped when a perfectly fine C++ compiler
> is present. So I investigated...
> 
> The log file of the respective test is:
> 
> --------------------------------------------------------------------------------
> #                             -*- compilation -*-
> 143. exceptions.at:24: testing C++ exception handling ...
> ./exceptions.at:33: case $LIBLTDL in #(
>   */_inst/lib/*) test -f "$LIBLTDL" || (exit 77) ;;
> esac
> stdout:
> ./exceptions.at:361: $CXX $CPPFLAGS $CXXFLAGS -DUSING_COMMON_DLL -DUSING_MODULE_DLL -DUSING_LIB_DLL -c main.cpp || exit 77
> stderr:
> In file included from main.cpp:7:
> lib.h:30:26: error: ISO C++17 does not allow dynamic exception specifications
>     30 | int LIB_IMPEXP libfoo () throw (libexc);
>        |                          ^~~~~
> In file included from main.cpp:8:
> module.h:17:40: error: ISO C++17 does not allow dynamic exception specifications
>     17 | extern "C" int MODULE_IMPEXP modfoo () throw (modexc);
>        |                                        ^~~~~
> main.cpp:22:16: error: ISO C++17 does not allow dynamic exception specifications
>     22 | int foo (void) throw (exc)
>        |                ^~~~~
> stdout:
> 143. exceptions.at:24: 143. C++ exception handling (exceptions.at:24): skipped (exceptions.at:361)
> --------------------------------------------------------------------------------
> 
> The problem is apparently that the test uses old syntax that was deprecated
> in C++11 and removed in C++17 [1]. The new syntax is described in [2].
> 
> The attached patch fixes it.
> 
> [1] https://en.cppreference.com/w/cpp/language/except_spec
> [2] https://en.cppreference.com/w/cpp/language/noexcept_spec
> 

Thank you for the patch. This has been applied in libtool:

https://git.savannah.gnu.org/cgit/libtool.git/commit/?h=development&id=17fb010919e9f7e28fe28e13f2710bb85b00cb3a

-- 
Ileana Dumitrescu

GPG Public Key: FA26 CA78 4BE1 8892 7F22 B99F 6570 EA01 146F 7354
[OpenPGP_0x6570EA01146F7354.asc (application/pgp-keys, attachment)]
[OpenPGP_signature.asc (application/pgp-signature, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 30 Jul 2024 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 116 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.