ludwigpacifici / modern-cpp-font-lock

C++ font-lock for Emacs
https://melpa.org/#/modern-cpp-font-lock
GNU General Public License v3.0
168 stars 11 forks source link

operator""() wrecks font-lock #27

Open oschonrock opened 4 years ago

oschonrock commented 4 years ago
     constexpr auto operator""m(unsigned long long l) { return quantity<metre, std::int64_t>(l); }                                                                                                                                                                                                                                                                  

which is trying to define a UDL in this library

https://github.com/mpusz/units

ludwigpacifici commented 4 years ago

Hello,

I am not able to reproduce your issue:

operator

I suggest you to reproduce your issue with a minimal configuration. If the issue is still there, can you report it to cc-mode which is the official Emacs C++ support. If the bug is fixed upstream, all Emacs users will get a fix. This package was a temporary fix at the time of C++11 was released.

stanford-scs commented 2 years ago

I ran into the same problem and can reproduce the issue with a minimal config. To reproduce, do the following steps.

  1. Copy this file to hexstring.cc.
  2. Start emacs 28.1 in a completely empty home directory with no dot files.
  3. Use M-: to run (require 'package)
  4. Use M-: to run (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
  5. Run M-x package-install RET modern-cpp-font-lock RET
  6. Run M-x modern-c++-font-lock-global-mode
  7. Visit hexstring.cc

The result will look like this: emacs