cling icon indicating copy to clipboard operation
cling copied to clipboard

Problem with defining functions with noexcept specifier

Open SdtElectronics opened this issue 2 years ago • 2 comments

  • [x] Checked for duplicates

Describe the bug

A simple function definition with noexcept specifier fails with the error function definition is not allowed here

void f() noexcept {}
input_line_3:2:20: error: function definition is not allowed here
 void f() noexcept {}

Expected behavior

Function definition with noexcept specifier should be interpreted correctly.

To Reproduce

Give the input below to Cling:

void f() noexcept {}

Setup

This problem was discovered by @edfink234 in the Cline project. The Cling used by the Cline in service was build upon https://github.com/root-project/cling/commit/1d5536fd0bc1ed3d3cedcd98d78e77208d772602. I verified it is reproducible on ROOT 6.24/06 as well.

Additional context

N/A

SdtElectronics avatar Mar 01 '23 00:03 SdtElectronics

Also reproducible in 6.26/10 macosxarm64

edfink234 avatar Mar 01 '23 09:03 edfink234

Thanks all for the report! This is related to https://github.com/root-project/root/issues/9449, for which we have a PR with some comments pending to be solved here: https://github.com/root-project/root/pull/11265.

This is not directly tackled in the aforementioned PR, but it should be also doable.

jalopezg-git avatar Mar 02 '23 12:03 jalopezg-git