Skip to content

Commit 874dae5

Browse files
authored
Merge pull request #6553 from tautschnig/merged-type
C front-end: fix type checking with merged type
2 parents 68c460a + 720c5e3 commit 874dae5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

regression/ansi-c/gcc_attributes1/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ void my_f1()
3939
while(1);
4040
}
4141

42+
inline void a() __attribute__((noreturn))
43+
{
44+
}
45+
4246
//
4347
// unused
4448
//

src/ansi-c/ansi_c_declaration.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ void ansi_c_declarationt::to_symbol(
141141
symbol.is_weak=get_is_weak();
142142

143143
// is it a function?
144-
const typet &type = symbol.type.id() == ID_merged_type
145-
? to_merged_type(symbol.type).last_type()
146-
: symbol.type;
144+
typet &type = symbol.type.id() == ID_merged_type
145+
? to_merged_type(symbol.type).last_type()
146+
: symbol.type;
147147

148148
if(type.id() == ID_code && !symbol.is_type)
149149
{
@@ -153,7 +153,7 @@ void ansi_c_declarationt::to_symbol(
153153
symbol.is_file_local=get_is_static();
154154

155155
if(get_is_inline())
156-
to_code_type(symbol.type).set_inlined(true);
156+
to_code_type(type).set_inlined(true);
157157

158158
if(
159159
config.ansi_c.mode == configt::ansi_ct::flavourt::GCC ||

0 commit comments

Comments
 (0)