Skip to content

Commit 615abbc

Browse files
committed
Summary
- Added handling for Compiler Explorer - Added README table with diagnostic message examples in Compiler Explorer Signed-off-by: Greg von Winckel <gregvw@gmail.com>
1 parent 9382dc8 commit 615abbc

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,18 @@ TInCuP bridges the gap between `tag_invoke`'s theoretical benefits and practical
6767

6868
Want to experiment with TInCuP before installing? Use our Compiler Explorer examples:
6969

70-
- Compiler flags used: `-std=c++20 -O2 -DTINCUP_DIAGNOSTIC_LEVEL=3`
70+
- Compiler flags used: `-std=c++20 -Wno-c++26-extensions -O2 -DTINCUP_DIAGNOSTIC_LEVEL=3 -DCOMPILER_EXPLORER`
7171
* [Basic Printing](https://godbolt.org/z/3945vq437)
7272
* [Bool Dispatch](https://godbolt.org/z/K1xcqqPad)
73-
* Enhanced Error Diagnostics:
74-
- [Forgetting to dereference](https://godbolt.org/z/TKbvz8fMd)
7573

76-
These examples demonstrate that TInCuP:
77-
- ✅ Works with all major compilers (GCC, Clang, MSVC)
78-
- ✅ Produces optimal assembly (check the "Add New → Opt Output" panel)
79-
- ✅ Provides clear error messages
74+
### Enhanced Error Diagnostics:
75+
76+
| Error \ Compiler | clang-20.1.0 | x86-64 gcc 14.1 |
77+
| :--- | :--- | :--- |
78+
| Forgetting to Dereference a Pointer | [CLICK](https://godbolt.org/z/vTG4hrKrx) | [CLICK](https://godbolt.org/z/baEqsshvY) |
79+
| Passing a `const` When Mutable Expected | [CLICK](https://godbolt.org/z/Mdc381Gz4) | [CLICK](https://godbolt.org/z/n8rd68WYG) |
80+
| Incorrect Argument Order | [CLICK](https://godbolt.org/z/349nK567j) | [CLICK](https://godbolt.org/z/zhPh7rha5) |
81+
| Incorrect Arity | [CLICK](https://godbolt.org/z/9dfaahc73) | [CLICK](https://godbolt.org/z/Echj4Tf35) |
8082

8183
## Installation
8284

tests/diagnostic_messages/test_argument_order_mismatch.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ Government retains certain rights in this software.
88
Questions? Contact Greg von Winckel (gvonwin@sandia.gov)
99
*/
1010

11+
#ifdef COMPILER_EXPLORER
12+
#include <https://raw.githubusercontent.com/sandialabs/TInCuP/main/single_include/tincup.hpp>
13+
#else
1114
#include "single_include/tincup.hpp"
15+
#endif
16+
1217
#include <string>
1318

1419
// This CPO has a specific argument order

tests/diagnostic_messages/test_arity_mismatch.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ Government retains certain rights in this software.
88
Questions? Contact Greg von Winckel (gvonwin@sandia.gov)
99
*/
1010

11+
#ifdef COMPILER_EXPLORER
12+
#include <https://raw.githubusercontent.com/sandialabs/TInCuP/main/single_include/tincup.hpp>
13+
#else
1114
#include "single_include/tincup.hpp"
15+
#endif
1216

1317
// This CPO has a specific arity
1418
inline constexpr struct two_arg_op_ftor final : tincup::cpo_base<two_arg_op_ftor> {

tests/diagnostic_messages/test_const_mismatch.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ Government retains certain rights in this software.
88
Questions? Contact Greg von Winckel (gvonwin@sandia.gov)
99
*/
1010

11+
#ifdef COMPILER_EXPLORER
12+
#include <https://raw.githubusercontent.com/sandialabs/TInCuP/main/single_include/tincup.hpp>
13+
#else
1114
#include "single_include/tincup.hpp"
15+
#endif
1216

1317
// This CPO expects a non-const reference
1418
inline constexpr struct mutating_op_ftor final : tincup::cpo_base<mutating_op_ftor> {

tests/diagnostic_messages/test_dereference_diagnostic.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ Government retains certain rights in this software.
88
Questions? Contact Greg von Winckel (gvonwin@sandia.gov)
99
*/
1010

11+
#ifdef COMPILER_EXPLORER
12+
#include <https://raw.githubusercontent.com/sandialabs/TInCuP/main/single_include/tincup.hpp>
13+
#else
1114
#include "single_include/tincup.hpp"
15+
#endif
16+
1217
#include <memory>
1318
#include <cmath>
1419
#include <utility>

0 commit comments

Comments
 (0)