Skip to content
Closed
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
4 changes: 3 additions & 1 deletion source/to_cpp1.h
Original file line number Diff line number Diff line change
Expand Up @@ -6719,7 +6719,9 @@ class cppfront

// Emit "auto" for deduced types (of course)
if (type->is_wildcard()) {
assert(n.initializer);
if(!n.initializer) {
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be an error recorded here, like at line 6735?

Copy link
Contributor Author

@sookach sookach Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there would be a double reporting of the error since sema already records it.

cppfront/source/sema.h

Lines 1526 to 1529 in 442d17c

errors.emplace_back(
n.position(),
"an object with a deduced type must have an = initializer"
);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good eye though

}
emit( *type, n.position() );
}
// Otherwise, emit the type
Expand Down