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

Specialization of variable templates misses type deduction and template #556

Closed
Ukilele opened this issue Aug 18, 2023 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@Ukilele
Copy link

Ukilele commented Aug 18, 2023

The following code:

template<class T> auto Value = 10;
template<> auto Value<char> = 0.0;

generates following output in cppinsights:

template<class T>
int Value = 10;
<> auto Value<char> = 0.0;

There are two issues:

  1. For both, the primary template and the specialization of Value, we use auto. But only in the primary template cppinsights replaces auto by int. But it would be nice if also for the specialization it would replace auto by the according type (double).
  2. In line 3 of the output of cppinsights, it is missing the keyword template in front of the <>.
@andreasfertig andreasfertig added the bug Something isn't working label Sep 6, 2023
@andreasfertig
Copy link
Owner

Hello @Ukilele,

thanks for reporting this issue!

A fix is on its way.

Andreas

andreasfertig added a commit that referenced this issue Sep 6, 2023
Fixed #556: Support for explicit specialization of variable template.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants