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

TEMPLATE_TEST_CASE: "duplicate type detected" should not be an error (allow duplicate types) #1628

Closed
VioletGiraffe opened this issue May 12, 2019 · 1 comment

Comments

@VioletGiraffe
Copy link

VioletGiraffe commented May 12, 2019

"Duplicate type" is a very inconvenient error as it will make some simple test cases require a lot of boilerplate code to circumvent this compile-time check. The thing is that certain types may or may not be synonymous depending on the current platform, and when writing cross-platform code, one may just want to list all imaginable types. Sure, the test case may run twice for the same actual type, but so what?

Example: size_t may be a synonym for unsigned long - then size_t is incompatible with unsigned long long, or it could be vice versa. I wanted to simply list all three (size_t, unsigned long, unsigned long long) and I got this compilation error.

@horenmar
Copy link
Member

That is a good point we did not consider.

horenmar added a commit that referenced this issue Sep 20, 2019
It was used in checking that types in TEMPLATE_TEST_CASE and friends
were unique, but this was removed for v2.8.0 (#1628). Since there
are no further uses of this trait, the simplest thing to do is to
just remove it.

Fixes #1757
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants