Open startup73 opened 7 years ago
Thanks for reporting this. I also saw it last week while getting a demo ready for CppCon, but forgot to log an issue for it. I was able to work around the issue by adding whitespace between the quoted text and the argument (e.g. "format" in your case)
I have noticed this as well, still now. When I use catch2 (c++ testing framework), all of my REQUIRE macros will be underlined with this "error".
The bug repros with Visual Studio as well. I've reported bug https://developercommunity.visualstudio.com/content/problem/377739/c-intellisense-reports-invalid-user-defined-litera.html .
As a workaround, you could use "[%s|%d]"##format
or "[%s|%d]" format
as Bob suggested.
You also need a comma before the "...".
When I use catch2 (c++ testing framework), all of my REQUIRE macros will be underlined with this "error".
I am using Catch2 as well and it is driving me crazy. What have you done in the mean time? Disable error squiggles altogether?
Hi @pedzed
I reported issue #2786 which relates a little bit more to my specific case with Catch2. Maybe you can try some of the suggestions made in there, however I found them unsuccessful. However, for unrelated reasons, we have since decided to use GoogleTest instead. GoogleTest did not have this problem.
I'm using Catch2, and I'm getting the same problem!
Upvote, it's driving me insane too. Using Catch2!
@shehabattia96 Upvotes to this issue may not be "counted", because the issue is being tracked by https://developercommunity.visualstudio.com/content/problem/377739/c-intellisense-reports-invalid-user-defined-litera.html , but that requies a Microsoft account to upvote.
I've filed a request to enable GitHub users to upvote VS issues without a Microsoft account at https://developercommunity.visualstudio.com/idea/869998/enable-vs-code-users-with-github-accounts-to-upvot.html
UPDATE: Upvotes to this GitHub issue are sufficient now.
@sean-mcmanus Thanks for creating a ticket and for letting me know! HNY!
A potential workaround is to use
#if __INTELLISENSE__
#pragma diag_suppress 2486
#endif
Great solution, is this documented anywhere?
I don't know. Might not be. I'm not sure where a good place would be to document that though.
Operating Sytem:Win7 X86_64 VS Code: V1.17.0-insider C/C++ extension version: 0.13.0
only if
do{
in the same line with definea.h
a.cpp