diff options
| author | Martin Hořeňovský | 2021-08-19 19:06:23 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2021-08-19 19:15:46 +0200 |
| commit | 4113a12c69809d72a3d92345ec47ccc5a0bf141c (patch) | |
| tree | 0f2ab58a6690a005536ae292d2aa6fbccf9cec31 /docs/contributing.md | |
| parent | edad4d0af7a91693448bbf884236ea6ff2a4bd15 (diff) | |
| download | catch3-4113a12c69809d72a3d92345ec47ccc5a0bf141c.tar.gz | |
Fix Wreserved-identifier for UDLs in Catch2
See #578
Diffstat (limited to 'docs/contributing.md')
| -rw-r--r-- | docs/contributing.md | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/contributing.md b/docs/contributing.md index dc6bb537..f70b1e45 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -239,6 +239,23 @@ there is no difference is wrong, QNX and VxWorks won't compile if you include the header as `<cfoo>` and call the function unqualified. +#### User-Defined Literals (UDL) for Catch2' types + +Due to messy standardese and ... not great ... implementation of +`-Wreserved-identifier` in Clang, avoid declaring UDLs as +```cpp +Approx operator "" _a(long double); +``` +and instead declare them as +```cpp +Approx operator ""_a(long double); +``` + +Notice that the second version does not have a space between the `""` and +the literal suffix. + + + ### New source file template If you are adding new source file, there is a template you should use. |