Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion regression/cpp/Template_Specialisation2/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KNOWNBUG
CORE
main.ii

^EXIT=0$
Expand Down
7 changes: 7 additions & 0 deletions src/cpp/cpp_typecheck_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ void cpp_typecheckt::typecheck_type(typet &type)
}
else if(type.id()==ID_pointer)
{
c_qualifierst qualifiers(type);

// the pointer/reference might have a qualifier,
// but do subtype first
typecheck_type(type.subtype());
Expand Down Expand Up @@ -114,6 +116,11 @@ void cpp_typecheckt::typecheck_type(typet &type)
}
}
}

if(type.get_bool(ID_C_constant))
qualifiers.is_constant = true;

qualifiers.write(type);
}
else if(type.id()==ID_array)
{
Expand Down
8 changes: 7 additions & 1 deletion src/cpp/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5222,7 +5222,13 @@ bool Parser::rTypeName(typet &tname)
if(!rDeclarator(declarator, kCastDeclarator, false, false))
return false;

tname.swap(declarator.type());
if(!declarator.method_qualifier().id().empty())
{
tname.swap(declarator.method_qualifier());
merge_types(declarator.type(), tname);
}
else
tname.swap(declarator.type());

// make type_name subtype of arg
make_subtype(type_name, tname);
Expand Down