From d6858f2d1612027d79acf8ea231f7b4c5859efa1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 11 Oct 2018 17:42:38 +0200 Subject: Work around compiler issues in qualified_option class template --- bpkg/auth.cxx | 6 +++--- bpkg/options-types.hxx | 8 ++++---- bpkg/types-parsers.hxx | 2 +- bpkg/types-parsers.txx | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bpkg/auth.cxx b/bpkg/auth.cxx index 48ba56f..787a705 100644 --- a/bpkg/auth.cxx +++ b/bpkg/auth.cxx @@ -29,9 +29,9 @@ namespace bpkg static const string openssl_rsautl ("rsautl"); static const string openssl_x509 ("x509"); - const char* openssl_commands[] = {openssl_rsautl.c_str (), - openssl_x509.c_str (), - nullptr}; + const char* openssl_commands[3] = {openssl_rsautl.c_str (), + openssl_x509.c_str (), + nullptr}; // Print process command line. // diff --git a/bpkg/options-types.hxx b/bpkg/options-types.hxx index 3438be1..76650f1 100644 --- a/bpkg/options-types.hxx +++ b/bpkg/options-types.hxx @@ -31,7 +31,7 @@ namespace bpkg // // const char* option_qualifiers[] = {"foo", "bar", nullptr}; // - template + template class qualified_option: public std::map { public: @@ -39,7 +39,7 @@ namespace bpkg template explicit - qualified_option (T v) {this->emplace ("", std::move (v));} + qualified_option (T v) {this->emplace (string (), V (std::move (v)));} qualified_option (): qualified_option (V ()) {} @@ -50,7 +50,7 @@ namespace bpkg { auto verify = [&q] () { - for (const char** p (Q); *p != nullptr; ++p) + for (const char* const* p (Q); *p != nullptr; ++p) { if (q == *p) return true; @@ -70,7 +70,7 @@ namespace bpkg } }; - extern const char* openssl_commands[]; + extern const char* openssl_commands[3]; // Clang bug requres explicit size. } #endif // BPKG_OPTIONS_TYPES_HXX diff --git a/bpkg/types-parsers.hxx b/bpkg/types-parsers.hxx index 24cc92d..d384223 100644 --- a/bpkg/types-parsers.hxx +++ b/bpkg/types-parsers.hxx @@ -47,7 +47,7 @@ namespace bpkg parse (repository_type&, bool&, scanner&); }; - template + template struct parser> { static void diff --git a/bpkg/types-parsers.txx b/bpkg/types-parsers.txx index 7a40b0e..a747417 100644 --- a/bpkg/types-parsers.txx +++ b/bpkg/types-parsers.txx @@ -6,7 +6,7 @@ namespace bpkg { namespace cli { - template + template void parser>:: parse (qualified_option& x, bool& xs, scanner& s) { @@ -25,7 +25,7 @@ namespace bpkg if (n != string::npos) { - const char** q (Q); + const char* const* q (Q); for (; *q != nullptr; ++q) { if (v.compare (0, n, *q) == 0) @@ -58,7 +58,7 @@ namespace bpkg // if (qv.empty ()) { - for (const char** q (Q); *q != nullptr; ++q) + for (const char* const* q (Q); *q != nullptr; ++q) { argv_scanner s (0, ac, av); parser::parse (x[*q], dummy, s); -- cgit v1.1