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

improve type traits support #2316

Merged
merged 1 commit into from
Feb 18, 2022
Merged

Conversation

guwirth
Copy link
Collaborator

@guwirth guwirth commented Feb 18, 2022

Samples:

struct C {
    template<typename T, std::enable_if_t< std::is_integral_t<T>, int> = 0 >
    C( T num ) {}

    template<typename T, std::enable_if_t< std::is_integral_v<T>, int> = 0 >
    int foo( T num ) {}
};

template< typename T, std::enable_if_t< std::is_integral_v<T>, int> >
A operator+( T num ) {}

template< typename T, std::enable_if_t< std::is_integral_v<T>, int> = 0>
A operator+( T num ) {}

This change is Reviewable

- close SonarOpenCommunity#2306

```C++
struct C {
    template<typename T, std::enable_if_t< std::is_integral_t<T>, int> = 0 >
    C( T num ) {}

    template<typename T, std::enable_if_t< std::is_integral_v<T>, int> = 0 >
    int foo( T num ) {}
};

template< typename T, std::enable_if_t< std::is_integral_v<T>, int> >
A operator+( T num ) {}

template< typename T, std::enable_if_t< std::is_integral_v<T>, int> = 0>
A operator+( T num ) {}
```
@guwirth guwirth added the bug label Feb 18, 2022
@guwirth guwirth added this to the 2.0.7 milestone Feb 18, 2022
@guwirth guwirth self-assigned this Feb 18, 2022
@guwirth guwirth merged commit 84a3ea8 into SonarOpenCommunity:master Feb 18, 2022
@guwirth guwirth deleted the improve-2306 branch July 26, 2022 09:07
@guwirth guwirth restored the improve-2306 branch July 26, 2022 09:15
@guwirth guwirth deleted the improve-2306 branch July 26, 2022 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

template parameter std::enable_if_t not parsed
1 participant