better-cpp-syntax icon indicating copy to clipboard operation
better-cpp-syntax copied to clipboard

parentheses getting different scopes again

Open mxdh opened this issue 5 years ago • 0 comments

Checklist

  • [ ] This problem exists even with the setting "C_Cpp.enhancedColorization": "Disabled"
  • [ ] This bug exists for C
  • [X] This bug exists for C++
  • [ ] This bug exists for Objective-C
  • [ ] This bug exists for Objective-C++

The code with a problem is:

#include <algorithm>
#include <functional>
#include <iostream>
#include <type_traits>
#include <utility>

template <typename _Tp>
concept number = requires {
  requires(
      std::is_same_v<_Tp, std::remove_reference<decltype(
                              std::declval<_Tp>() + std::declval<_Tp>())> >);
};

int main() {
  static_assert(std::is_same_v<int, decltype(1 + 1)>);
  std::cout << "int is a number: " << number<int> << std::endl;
  std::cout << "pointer is a number: " << number<void*> << std::endl;
}

It looks like:

屏幕截图 2020-11-24 221500 Cold Horizon

It should look like:

Sorry,I'm not good at English. I think each pair of parentheses should match each other.

mxdh avatar Nov 24 '20 14:11 mxdh