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

C++14: add type traits helper support #2306

Merged
merged 1 commit into from
Feb 11, 2022

Conversation

guwirth
Copy link
Collaborator

@guwirth guwirth commented Feb 11, 2022

template <typename T, typename std::enable_if  <std::is_base_of<BaseT, T>::value, int>::type = 0> class A {};
template <typename T,          std::enable_if_t<std::is_base_of<BaseT, T>::value, int>       = 0> class C {};

This change is Reviewable

- supporting type traits helper as typeParameter (e.g. std::enable_if_t)
- close SonarOpenCommunity#2305

```C++
template <typename T, typename std::enable_if  <std::is_base_of<BaseT, T>::value, int>::type = 0> class A {};
template <typename T,          std::enable_if_t<std::is_base_of<BaseT, T>::value, int>       = 0> class C {};
```
@guwirth guwirth added the bug label Feb 11, 2022
@guwirth guwirth added this to the 2.0.7 milestone Feb 11, 2022
@guwirth guwirth self-assigned this Feb 11, 2022
@guwirth guwirth merged commit e9a8171 into SonarOpenCommunity:master Feb 11, 2022
guwirth added a commit to guwirth/sonar-cxx that referenced this pull request Feb 18, 2022
- 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 deleted the fix-2305 branch July 26, 2022 09:06
@guwirth guwirth restored the fix-2305 branch July 26, 2022 09:14
@guwirth guwirth deleted the fix-2305 branch February 8, 2023 13:34
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