Fix constraints on from_json(CompatibleArrayType)
Fixes #924

The constraints on that overload were incorrect. We were checking that the `Array::value_type` could be converted **to** json, which makes no sense.

Surprising that no one had this issue before, I guess everybody converts from and to json...

Anyway, it should not happen from now.

* * *

## Pull request checklist

Read the [Contribution Guidelines](https://github.com/nlohmann/json/blob/develop/.github/CONTRIBUTING.md) for detailed information.

- [x]  Changes are described in the pull request, or an [existing issue is referenced](https://github.com/nlohmann/json/issues).
- [x]  The test suite [compiles and runs](https://github.com/nlohmann/json/blob/develop/README.md#execute-unit-tests) without error.
- [x]  [Code coverage](https://coveralls.io/github/nlohmann/json) is 100%. Test cases can be added by editing the [test suite](https://github.com/nlohmann/json/tree/develop/test/src).
- [x]  The source code is amalgamated; that is, after making changes to the sources in the `include/nlohmann` directory, run `make amalgamate` to create the single-header file `single_include/nlohmann/json.hpp`. The whole process is described [here](https://github.com/nlohmann/json/blob/develop/.github/CONTRIBUTING.md#files-to-change).

{"label": "nlohmann:develop", "ref": "develop", "sha": "b02e3bb0b6397b5e5f2c92b163c8fa25c414c635"}
**Bug Report**

The following code fails to compile when uncommenting line 16:
```c++
#include <nlohmann/json.hpp>

namespace nl = nlohmann;

struct S {
  S() = default;
  template<typename T> S(const T& t) {}
};

void from_json(const nl::json& j, S& s) {
}

int main() {
  nl::json j;
  auto s = j.get<S>();
  //auto v = j.get<std::vector<S>>();
};
```
The error I get is 
```
json.hpp(1360): error C2338: could not find from_json() method in T's namespace
```

The cause seems to stem from the check for `std::is_convertible<BasicJsonType, typename CompatibleArrayType::value_type>::value` on `void from_json(const BasicJsonType& j, CompatibleArrayType& arr)`. 

Since you do not convert directly from json to the array value but call `get()` I think this check can be changed to allow this to compile.

Compiled on VS 15.6.0 preview 2.0
Library version 3.0.1

converting json to vector of type with templated constructor
diff --git a/include/nlohmann/detail/conversions/from_json.hpp b/include/nlohmann/detail/conversions/from_json.hpp
index 8ea0284a15..eccc04f107 100644
--- a/include/nlohmann/detail/conversions/from_json.hpp
+++ b/include/nlohmann/detail/conversions/from_json.hpp
@@ -177,15 +177,21 @@ void from_json_array_impl(const BasicJsonType& j, std::array<T, N>& arr, priorit
     }
 }
 
-template<typename BasicJsonType, typename CompatibleArrayType,
-         enable_if_t<is_compatible_array_type<BasicJsonType, CompatibleArrayType>::value and
-                     std::is_convertible<BasicJsonType, typename CompatibleArrayType::value_type>::value and
-                     not std::is_same<typename BasicJsonType::array_t, CompatibleArrayType>::value, int> = 0>
+template <
+    typename BasicJsonType, typename CompatibleArrayType,
+    enable_if_t <
+        is_compatible_array_type<BasicJsonType, CompatibleArrayType>::value and
+        not std::is_same<typename BasicJsonType::array_t,
+                         CompatibleArrayType>::value and
+        std::is_constructible <
+            BasicJsonType, typename CompatibleArrayType::value_type >::value,
+        int > = 0 >
 void from_json(const BasicJsonType& j, CompatibleArrayType& arr)
 {
     if (JSON_UNLIKELY(not j.is_array()))
     {
-        JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name())));
+        JSON_THROW(type_error::create(302, "type must be array, but is " +
+                                      std::string(j.type_name())));
     }
 
     from_json_array_impl(j, arr, priority_tag<2> {});
diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp
index a7c009c0d2..c75305868a 100644
--- a/single_include/nlohmann/json.hpp
+++ b/single_include/nlohmann/json.hpp
@@ -1084,15 +1084,21 @@ void from_json_array_impl(const BasicJsonType& j, std::array<T, N>& arr, priorit
     }
 }
 
-template<typename BasicJsonType, typename CompatibleArrayType,
-         enable_if_t<is_compatible_array_type<BasicJsonType, CompatibleArrayType>::value and
-                     std::is_convertible<BasicJsonType, typename CompatibleArrayType::value_type>::value and
-                     not std::is_same<typename BasicJsonType::array_t, CompatibleArrayType>::value, int> = 0>
+template <
+    typename BasicJsonType, typename CompatibleArrayType,
+    enable_if_t <
+        is_compatible_array_type<BasicJsonType, CompatibleArrayType>::value and
+        not std::is_same<typename BasicJsonType::array_t,
+                         CompatibleArrayType>::value and
+        std::is_constructible <
+            BasicJsonType, typename CompatibleArrayType::value_type >::value,
+        int > = 0 >
 void from_json(const BasicJsonType& j, CompatibleArrayType& arr)
 {
     if (JSON_UNLIKELY(not j.is_array()))
     {
-        JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name())));
+        JSON_THROW(type_error::create(302, "type must be array, but is " +
+                                      std::string(j.type_name())));
     }
 
     from_json_array_impl(j, arr, priority_tag<2> {});

diff --git a/test/src/unit-inspection.cpp b/test/src/unit-inspection.cpp
index 5facb11674..4bee80d13b 100644
--- a/test/src/unit-inspection.cpp
+++ b/test/src/unit-inspection.cpp
@@ -316,8 +316,8 @@ TEST_CASE("object inspection")
     SECTION("round trips")
     {
         for (const auto& s :
-                {"3.141592653589793", "1000000000000000010E5"
-                })
+    {"3.141592653589793", "1000000000000000010E5"
+    })
         {
             json j1 = json::parse(s);
             std::string s1 = j1.dump();
diff --git a/test/src/unit-udt.cpp b/test/src/unit-udt.cpp
index 17baf4e524..65ca788a69 100644
--- a/test/src/unit-udt.cpp
+++ b/test/src/unit-udt.cpp
@@ -711,3 +711,25 @@ TEST_CASE("an incomplete type does not trigger a compiler error in non-evaluated
 {
     static_assert(not is_constructible_patched<json, incomplete>::value, "");
 }
+
+namespace
+{
+class Evil
+{
+  public:
+    Evil() = default;
+    template <typename T>
+    Evil(T) {}
+};
+
+void from_json(const json&, Evil&) {}
+}
+
+TEST_CASE("Issue #924")
+{
+    // Prevent get<std::vector<Evil>>() to throw
+    auto j = json::array();
+
+    (void) j.get<Evil>();
+    (void) j.get<std::vector<Evil>>();
+}

{"test-json_pointer_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-regression_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-element_access2_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-items_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-modifiers_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-constructor1_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-reference_access_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-comparison_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_lexer_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_const_iterator_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_iterator_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-udt_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_const_iterator_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-constructor2_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-cbor_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-allocator_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-inspection_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-algorithms_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-testsuites_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-comparison_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-to_chars_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-constructor2_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-meta_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-allocator_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-readme_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-concepts_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-unicode_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-pointer_access_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-serialization_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-msgpack_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-msgpack_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-regression_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-convenience_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-conversions_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_parser_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-element_access1_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-readme_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-noexcept_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-element_access1_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-inspection_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_iterator_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-algorithms_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-unicode_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-items_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-conversions_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-noexcept_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-concepts_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-merge_patch_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-iterators2_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-pointer_access_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-iterators1_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-constructor1_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-cbor_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-modifiers_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-json_patch_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-to_chars_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-capacity_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-element_access2_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-ubjson_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-serialization_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-testsuites_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-iterators1_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-udt_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-reference_access_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_lexer_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-capacity_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-json_patch_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_parser_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-json_pointer_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-merge_patch_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-iterators2_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-deserialization_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-ubjson_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-convenience_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-meta_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-deserialization_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}}
{"test-json_pointer_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-regression_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-element_access2_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-items_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-modifiers_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-constructor1_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-reference_access_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-comparison_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_lexer_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_const_iterator_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_iterator_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-udt_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_const_iterator_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-constructor2_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-cbor_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-allocator_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-inspection_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-algorithms_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-testsuites_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-comparison_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-to_chars_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-constructor2_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-meta_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-allocator_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-readme_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-concepts_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-unicode_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-pointer_access_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-serialization_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-msgpack_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-msgpack_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-regression_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-convenience_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-conversions_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_parser_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-element_access1_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-readme_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-noexcept_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-element_access1_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-inspection_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_iterator_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-algorithms_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-unicode_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-items_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-conversions_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-noexcept_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-concepts_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-merge_patch_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-iterators2_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-pointer_access_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-iterators1_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-constructor1_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-cbor_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-modifiers_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-json_patch_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-to_chars_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-capacity_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-element_access2_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-ubjson_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-serialization_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-testsuites_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-iterators1_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-udt_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-reference_access_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_lexer_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-capacity_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-json_patch_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-class_parser_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-json_pointer_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-merge_patch_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-iterators2_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-deserialization_all": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-ubjson_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-convenience_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-meta_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test-deserialization_default": {"run": "PASS", "test": "NONE", "fix": "PASS"}}
{"passed_count": 76, "failed_count": 0, "skipped_count": 0, "passed_tests": ["test-json_pointer_default", "test-regression_all", "test-element_access2_default", "test-convenience_all", "test-items_all", "test-modifiers_all", "test-conversions_default", "test-class_parser_default", "test-constructor1_all", "test-reference_access_default", "test-element_access1_all", "test-readme_default", "test-comparison_default", "test-noexcept_default", "test-class_lexer_default", "test-class_const_iterator_all", "test-element_access1_default", "test-inspection_default", "test-class_iterator_all", "test-class_iterator_default", "test-algorithms_default", "test-unicode_all", "test-udt_all", "test-class_const_iterator_default", "test-items_default", "test-constructor2_default", "test-cbor_all", "test-allocator_default", "test-concepts_default", "test-conversions_all", "test-merge_patch_default", "test-noexcept_all", "test-iterators2_all", "test-inspection_all", "test-algorithms_all", "test-pointer_access_all", "test-iterators1_all", "test-testsuites_default", "test-comparison_all", "test-to_chars_all", "test-constructor1_default", "test-cbor_default", "test-modifiers_default", "test-json_patch_all", "test-to_chars_default", "test-capacity_all", "test-constructor2_all", "test-element_access2_all", "test-ubjson_all", "test-serialization_default", "test-testsuites_all", "test-meta_all", "test-allocator_all", "test-iterators1_default", "test-udt_default", "test-reference_access_all", "test-class_lexer_all", "test-capacity_default", "test-json_patch_default", "test-class_parser_all", "test-json_pointer_all", "test-merge_patch_all", "test-readme_all", "test-iterators2_default", "test-concepts_all", "test-unicode_default", "test-pointer_access_default", "test-serialization_all", "test-deserialization_all", "test-msgpack_default", "test-msgpack_all", "test-ubjson_default", "test-regression_default", "test-convenience_default", "test-meta_default", "test-deserialization_default"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 0, "failed_count": 0, "skipped_count": 0, "passed_tests": [], "failed_tests": [], "skipped_tests": []}
{"passed_count": 76, "failed_count": 0, "skipped_count": 0, "passed_tests": ["test-json_pointer_default", "test-regression_all", "test-element_access2_default", "test-convenience_all", "test-items_all", "test-modifiers_all", "test-conversions_default", "test-class_parser_default", "test-constructor1_all", "test-reference_access_default", "test-element_access1_all", "test-readme_default", "test-comparison_default", "test-noexcept_default", "test-class_lexer_default", "test-class_const_iterator_all", "test-element_access1_default", "test-inspection_default", "test-class_iterator_all", "test-class_iterator_default", "test-algorithms_default", "test-unicode_all", "test-udt_all", "test-class_const_iterator_default", "test-items_default", "test-constructor2_default", "test-cbor_all", "test-allocator_default", "test-concepts_default", "test-conversions_all", "test-merge_patch_default", "test-noexcept_all", "test-iterators2_all", "test-inspection_all", "test-algorithms_all", "test-pointer_access_all", "test-iterators1_all", "test-testsuites_default", "test-comparison_all", "test-to_chars_all", "test-constructor1_default", "test-cbor_default", "test-modifiers_default", "test-json_patch_all", "test-to_chars_default", "test-capacity_all", "test-constructor2_all", "test-element_access2_all", "test-ubjson_all", "test-serialization_default", "test-testsuites_all", "test-meta_all", "test-allocator_all", "test-iterators1_default", "test-udt_default", "test-reference_access_all", "test-class_lexer_all", "test-capacity_default", "test-json_patch_default", "test-class_parser_all", "test-json_pointer_all", "test-merge_patch_all", "test-readme_all", "test-iterators2_default", "test-concepts_all", "test-unicode_default", "test-pointer_access_default", "test-serialization_all", "test-deserialization_all", "test-msgpack_default", "test-msgpack_all", "test-ubjson_default", "test-regression_default", "test-convenience_default", "test-meta_default", "test-deserialization_default"], "failed_tests": [], "skipped_tests": []}