Skip to content

Segmentation fault on G++ when trying to assign json string literal to custom json type. #972

@lesf0

Description

@lesf0

Bug Report

This is the minimal code demonstrating the problem.

#include <iostream>
#include "json.hpp"
#include "fifo_map.hpp"

template<class K, class V, class dummy_compare, class A>
using my_workaround_fifo_map = nlohmann::fifo_map<K, V, nlohmann::fifo_map_compare<K>, A>;
using my_json = nlohmann::basic_json<my_workaround_fifo_map>;

int main()
{
	my_json foo = R"([1, 2, 3])"_json;
	
	std::cout << foo << std::endl;
}
$ g++ --version
g++ (GCC) 7.3.0
$ uname -a
Linux daddy 4.14.15-1-ARCH #1 SMP PREEMPT Tue Jan 23 21:49:25 UTC 2018 x86_64 GNU/Linux

Metadata

Metadata

Assignees

Labels

confirmedsolution: proposed fixa fix for the issue has been proposed and waits for confirmation

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions