Skip to content

Commit c55b529

Browse files
Don't use deprecated form of user-defined literal operator (#408)
* Don't use deprecated form of user-defined literal operator * add clang warning regarding deprecated literal operator --------- Co-authored-by: Hans Dembinski <hans.dembinski@gmail.com>
1 parent b5cce28 commit c55b529

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.github/workflows/slow.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,7 @@ jobs:
8585
- name: Test cxxstd=17 ubsan asan
8686
run: |
8787
cd libs/histogram
88-
../../b2 $B2_OPTS toolset=clang cxxstd=17 variant=histogram_ubasan test//all
88+
89+
# workaround: -Wdeprecated-literal-operator only works with clang and not with appleclang
90+
# Apparently, build.jam cannot make the distinction, so we have to specify it here
91+
../../b2 $B2_OPTS toolset=clang cxxstd=17 cxxflags="-Wdeprecated-literal-operator" variant=histogram_ubasan test//all

build.jam

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ constant boost_dependencies :
2222
project /boost/histogram
2323
: requirements
2424
<toolset>clang:<cxxflags>"-Wsign-compare -Wstrict-aliasing -fstrict-aliasing -Wvexing-parse -Wfloat-conversion"
25-
<toolset>darwin:<cxxflags>"-Wsign-compare -Wstrict-aliasing -fstrict-aliasing -Wvexing-parse -Wfloat-conversion"
2625
<toolset>gcc:<cxxflags>"-Wsign-compare -Wstrict-aliasing -fstrict-aliasing -Wfloat-conversion"
2726
<toolset>msvc:<cxxflags>"/bigobj"
2827
<toolset>intel-win:<cxxflags>"/bigobj"

include/boost/histogram/literals.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ constexpr unsigned parse_number(unsigned n, char f, Rest... rest) {
2323
namespace literals {
2424
/// Suffix operator to generate literal compile-time numbers, 0_c, 12_c, etc.
2525
template <char... digits>
26-
auto operator"" _c() {
26+
auto operator ""_c() {
2727
return std::integral_constant<unsigned, detail::parse_number(0, digits...)>();
2828
}
2929
} // namespace literals

0 commit comments

Comments
 (0)