Repository navigation
[[noreturn]] false positive when calling a [[noreturn]] constructor
#207
Closed
ilazaric
started this conversation in
Issue Triage - Compilation
Replies: 2 comments
|
Err, forgot to set the "Type of Issue", but don't see a clear fit for the issue. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Issue Summary
If a function marked with
[[noreturn]]construct an object whose constructor is marked[[noreturn]],this is not recognized, and an erroneous warning is emitted.
Reproducing Source Code
Command-line Options
cpfe repro.cpp
Type of Issue
[Front End] This code SHOULD NOT warn with these options.
Additional Details
In the example, both
B::B()andg()cause the warning to be emitted,and it is clear they can't actually return because of
A::A().Compiler output:
Godbolt: https://godbolt.org/z/nGvdedcsG
Also noting that the attribute on
A::A()is not fully ignored,if we remove the throw it warns there (as expected/correct).
Reproducing (Standard) Configuration(s)
linux-gcc-release
Reproducing (Non-standard) Configuration
No response
I acknowledge that:
LICENSE.txtfile in my.zipor.tar.gzupload. If I included aLICENSE.txtfile, any tests created using the reproducing source code will be governed by the terms of the license I provided instead.All reactions