Skip to content

Commit 0a63813

Browse files
committed
fix(to_cpp1): add typename only to a _qualified-id_
1 parent ab00e91 commit 0a63813

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

source/to_cpp1.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5059,9 +5059,13 @@ class cppfront
50595059
auto req = std::string{"std::is_convertible_v<CPP2_TYPEOF("};
50605060
req += identifier;
50615061
req += "), std::add_const_t<";
5062-
// The call to 'print_to_string' just computed this.
5063-
// We could cache that so it's reused here.
5064-
if (is_dependent(type_id)) {
5062+
if (
5063+
get_if<type_id_node::qualified>(&type_id.id)
5064+
// The call to 'print_to_string' just computed this.
5065+
// We could cache that so it's reused here.
5066+
&& is_dependent(type_id)
5067+
)
5068+
{
50655069
req += "typename ";
50665070
}
50675071
req += param_type;

0 commit comments

Comments
 (0)