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

Parsing error when using template type parameter with assignment #2321

Merged
merged 1 commit into from
Feb 24, 2022

Conversation

guwirth
Copy link
Collaborator

@guwirth guwirth commented Feb 22, 2022

There is a PEG issue with the order of

template-parameter:
   type-parameter
   parameter-declaration

type-parameter type-constraint rule matches in case of non integral data type.

Samples:

template <typename T, size_t s = 15 > void f() {}
template <typename T, size_t s = sizeof(T)*2 > void f() {}
template <typename T, size_t s = 1>2 > void f() {}
template <values v = v::ok> void f() {}
template<class T, T::type n = 0> class X;

This change is Reviewable

@guwirth guwirth added the bug label Feb 22, 2022
@guwirth guwirth added this to the 2.0.7 milestone Feb 22, 2022
@guwirth guwirth self-assigned this Feb 22, 2022
@guwirth guwirth force-pushed the fix-2317 branch 5 times, most recently from e3f3a62 to 2c89ba4 Compare February 23, 2022 17:03
- update to SQ 8.9.7.52159 for testing
- update to Maven 3.8.4
- use curl in AppVeyor
- close SonarOpenCommunity#2317

There is a PEG issue with the order of
```
template-parameter:
   type-parameter
   parameter-declaration
```
`type-parameter type-constraint' rule matches in case of non integral data type.

Samples:
```C++
template <typename T, size_t s = 15 > void f() {}
template <typename T, size_t s = sizeof(T)*2 > void f() {}
template <typename T, size_t s = 1>2 > void f() {}
template <values v = v::ok> void f() {}
template<class T, T::type n = 0> class X;
```
@guwirth guwirth merged commit e6a5f9e into SonarOpenCommunity:master Feb 24, 2022
@guwirth guwirth deleted the fix-2317 branch July 26, 2022 09:07
@guwirth guwirth restored the fix-2317 branch July 26, 2022 09:15
@guwirth guwirth deleted the fix-2317 branch July 26, 2022 12:29
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.

Parsing error when using template type parameter with assignment
1 participant