Skip to content
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

Improved parsing of templates #167

Merged
merged 1 commit into from
May 16, 2023
Merged

Conversation

sdkrystian
Copy link
Member

No description provided.

@sdkrystian sdkrystian requested a review from vinniefalco May 8, 2023 18:58
@sdkrystian sdkrystian force-pushed the templates branch 2 times, most recently from 1b7f620 to 56e0d97 Compare May 9, 2023 17:00
NonType,
// template template parameter, e.g. "template<typename> typename T"
Template,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Concepts are Type ?

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't handle concepts at all currently. Once I add partial/explicit specialization support, I'll add support for concepts & requirement clauses

Copy link
Member

Choose a reason for hiding this comment

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

concepts are a whole other ball of yarn

{
// default type for the type template parameter
std::optional<TypeInfo> Default;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Concept?

Copy link
Member

Choose a reason for hiding this comment

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

If there's a SymbolID in there, you could lose the optional.

@sdkrystian sdkrystian force-pushed the templates branch 3 times, most recently from 55272ca to 826aa52 Compare May 12, 2023 22:26
@sdkrystian sdkrystian force-pushed the templates branch 4 times, most recently from 34e59ae to fb82a73 Compare May 15, 2023 12:58
@sdkrystian sdkrystian force-pushed the templates branch 7 times, most recently from f2d90fe to 65bddb6 Compare May 16, 2023 14:18
@sdkrystian sdkrystian marked this pull request as ready for review May 16, 2023 14:25
@sdkrystian sdkrystian changed the title Parsing of template parameters Improved parsing of templates May 16, 2023
enum class TemplateParamKind : int
{
// KRYSTIAN NOTE: temporary
None,
Copy link
Member

Choose a reason for hiding this comment

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

wtf is "None?" if this is a real thing you need to write

None = 0, // for bitstream

but if None is going away you need to sort it, I dont like having enums that arent use. For example my Access doesn't have None (but clang::AccessSpecifier does, which is irritating).

Copy link
Member Author

Choose a reason for hiding this comment

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

None indicates a TParam without any extended info (e.g. TypeTParam).

ND->isTemplateParameterPack());

if(const auto* TP = dyn_cast<
TemplateTypeParmDecl>(ND))
Copy link
Member

@vinniefalco vinniefalco May 16, 2023

Choose a reason for hiding this comment

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

This is begging for if constexpr LOL. Not now though. Later.

@sdkrystian sdkrystian force-pushed the templates branch 9 times, most recently from 3853358 to 1ab2c99 Compare May 16, 2023 17:12
sdkrystian added a commit to sdkrystian/mrdocs that referenced this pull request May 16, 2023
@sdkrystian sdkrystian merged commit d9efa40 into cppalliance:develop May 16, 2023
@sdkrystian sdkrystian deleted the templates branch May 16, 2023 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants