Repository navigation
[GNATS 23530] Spurious diagnostic for previously declared gnu_inline attribute #121
jhsedg
started this conversation in
Issue Triage - General
Replies: 0 comments
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.
Customer bug ID
geometry tests
Description
extern inline int f();
__attribute((gnu_inline)) extern inline int f() { return 0; }
[ellen@lin1 boost_1_74_0]$ $CPFEB --gnu_version 80100 -tused --c++17 /tmp/p.C
"/tmp/p.C", line 2: error: function was previously declared without the
"gnu_inline" attribute
__attribute((gnu_inline)) extern inline int f() { return 0; }
^
1 error detected in the compilation of "/tmp/p.C".
Notes
mjh, 2020-11-10:
Here's a better reproducer:
//options_all:--gn 80100
extern int f();
extern inline attribute ((gnu_inline)) int f() { return 0; }
The issue here is that the cp_gen_be config that was being used had CP_GEN_BE_TARGET_MATCHES_SOURCE_DIALECT set to FALSE, so "inline" was being emitted rather than the gnu_inline attribute in the declaration case leading to this generated C++:
extern inline int f();
__attribute((gnu_inline)) extern inline int f() { return 0; }
That causes the error that was reported when compiling the output (a valid diagnostic).
Reducing the severity of this.
All reactions