-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
On text operator, reported unexpected error #13036
Comments
@pointertobios I'm seeing compiler errors with g++/clang++ -- what version are you using and what args like -std=c++20 are you using? |
@sean-mcmanus yes c++20 |
@sean-mcmanus sorry I just type wrong code.the argument is also unsigned long long in my actually used code.I corrected the example now. |
In clang++ add a _ before can be compiled. |
Hi @pointertobios . If I add "_", like so: inline constexpr unsigned long long operator"" _u64(unsigned long long n){return n;}
auto x = 0xfff_u64 + 1_u64;
int main() {
return 0;
} ... For me, that both allows the code to compile with clang++ and clears up the IntelliSense squiggle. If you're seeing something different, could you provide a complete example, in the form of a zip file or GitHub repo, that we might use to reproduce exactly what you're seeing? |
@Colengms clang++ gives an error, but g++ (and cl.exe) only gives a warning. IntelliSense is normally not supposed to give errors in warning cases. But writing code that only compiles with g++ and not other compilers (or potential future g++ versions) isn't recommended. |
I've filed a bug on our shared VS parser at https://developercommunity.visualstudio.com/t/C-IntelliSense-gives-error-for-operato/10809064 |
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
reported "Extra text after expected end of number" on
0xfffu64
and1u64
and consider them asint
.But it can be compiled by g++ and clang++. And there is no limit about number character on the text operator in C++ standard.
Configuration and Logs
Other Extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: