Skip to content

Fix cppfront incomplete type build error (fix #690) #691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 22, 2023
Merged
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
21 changes: 10 additions & 11 deletions source/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ struct primary_expression_node
auto is_literal() const
-> bool;

auto template_arguments() const -> std::vector<template_argument>&;
auto template_arguments() const -> std::vector<template_argument> const&;

auto get_token() const -> token const*;

Expand Down Expand Up @@ -1024,11 +1024,10 @@ struct template_argument

auto to_string() const
-> std::string;

// So that template_arguments() accessors can return a reference to an empty arg list
static inline std::vector<template_argument> no_template_args;
};

// Used by functions that must return a reference to an empty arg list
inline std::vector<template_argument> const no_template_args;

struct unqualified_id_node
{
Expand All @@ -1040,8 +1039,8 @@ struct unqualified_id_node

std::vector<template_argument> template_args;

auto template_arguments()
-> std::vector<template_argument>&
auto template_arguments() const
-> std::vector<template_argument> const&
{
return template_args;
}
Expand Down Expand Up @@ -1104,7 +1103,7 @@ struct qualified_id_node
std::vector<term> ids;

auto template_arguments() const
-> std::vector<template_argument>&
-> std::vector<template_argument> const&
{
return ids.back().id->template_arguments();
}
Expand Down Expand Up @@ -1223,7 +1222,7 @@ struct type_id_node
}

auto template_arguments() const
-> std::vector<template_argument>&
-> std::vector<template_argument> const&
{
if (id.index() == unqualified) {
return std::get<unqualified>(id)->template_arguments();
Expand Down Expand Up @@ -1467,7 +1466,7 @@ struct id_expression_node
> id;

auto template_arguments() const
-> std::vector<template_argument>&
-> std::vector<template_argument> const&
{
if (is_unqualified()) {
return std::get<unqualified>(id)->template_arguments();
Expand Down Expand Up @@ -3641,13 +3640,13 @@ auto function_type_node::is_destructor() const


auto primary_expression_node::template_arguments() const
-> std::vector<template_argument>&
-> std::vector<template_argument> const&
{
if (expr.index() == id_expression) {
return std::get<id_expression>(expr)->template_arguments();
}
// else
return template_argument::no_template_args;
return no_template_args;
}


Expand Down