Skip to content

Fix operator name keywords causing obscure errors on -fno-operator-names #525

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

Closed
wants to merge 1 commit into from

Conversation

uoysip
Copy link

@uoysip uoysip commented Mar 6, 2024

Alternative operator name keywords like and, or, xor, etc., are rarely used in MySQL and can cause obscure errors when the GCC flag -fno-operator-names is applied, for example:

/MySQL/storage/temptable/include/temptable/lock_free_type.h:125:75: error: template argument 2 is invalid
  125 |                                std::is_trivially_copyable<T>::value>::type> {
      |                                                                           ^
/MySQL/storage/temptable/include/temptable/lock_free_type.h:148:19: error: parse error in template argument list
  148 |     typename std::enable_if<std::is_same<T, long long>::value or
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  149 |                             std::is_same<T, unsigned long long>::value>::type> {
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Replace the few occurrences of operator name keywords to use their primary counter parts, like &&, ||, and !.

…-names

Alternative operator name keywords like `and`, `or`, `xor`, etc., are
rarely used in MySQL and can cause obscure errors when the GCC flag
`-fno-operator-names` is applied, for example:

```
/MySQL/storage/temptable/include/temptable/lock_free_type.h:125:75: error: template argument 2 is invalid
  125 |                                std::is_trivially_copyable<T>::value>::type> {
      |                                                                           ^
/MySQL/storage/temptable/include/temptable/lock_free_type.h:148:19: error: parse error in template argument list
  148 |     typename std::enable_if<std::is_same<T, long long>::value or
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  149 |                             std::is_same<T, unsigned long long>::value>::type> {
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Replace the few occurrences of operator name keywords to use their
primary counter parts, like `&&`, `||`, and `!`.
@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Please confirm this code is submitted under the terms of the OCA (Oracle's Contribution Agreement) you have previously signed by cutting and pasting the following text as a comment:
"I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it."
Thanks

@uoysip
Copy link
Author

uoysip commented Mar 7, 2024

This contribution is under the OCA signed by Amazon and covering submissions to the MySQL project.

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Your code has been assigned to an internal queue. Please follow
bug http://bugs.mysql.com/bug.php?id=114270 for updates.
Thanks

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

Successfully merging this pull request may close these issues.

2 participants