@@ -38,30 +38,30 @@ BOOST_AUTO_TEST_CASE(carries_semantic_debug_data)
3838 ethdebugPointer.name = " value" ;
3939 ethdebugPointer.slot = " pointer:value" ;
4040
41- auto semanticDebugData = std::make_shared<SemanticDebugData const >(SemanticDebugData{
42- . lexicalScopeID = 17 ,
43- . variableDefinitions = {{
44- . name = " value " ,
45- . declarationAstID = 23 ,
46- . declarationLocation = SourceLocation{ 1 , 6 , std::make_shared<std::string>( " input.sol " )},
47- . typeID = " type:uint256 " ,
48- . ethdebugType = SemanticDebugType{
49- . typeClass = SemanticDebugType::Class::Elementary,
50- . kind = SemanticDebugType::Kind::Uint,
51- . bits = 256 ,
52- . places = std:: nullopt ,
53- . bytes = std:: nullopt ,
54- . dataLocation = std:: nullopt ,
55- . payable = std::nullopt ,
56- . dynamic = std:: nullopt
57- },
58- .location = SemanticDebugVariableLocation{
59- . kind = SemanticDebugVariableLocation::Kind::Stack,
60- . pointerID = " pointer:value "
61- },
62- . ethdebugPointer = ethdebugPointer
63- }}
64- } );
41+ // NOTE: Built imperatively instead of with nested designated initializers,
42+ // which crash MSVC with an internal compiler error.
43+ SemanticDebugType ethdebugType;
44+ ethdebugType. typeClass = SemanticDebugType::Class::Elementary;
45+ ethdebugType. kind = SemanticDebugType::Kind::Uint;
46+ ethdebugType. bits = 256 ;
47+
48+ SemanticDebugVariableLocation location;
49+ location. kind = SemanticDebugVariableLocation::Kind::Stack;
50+ location. pointerID = " pointer:value " ;
51+
52+ SemanticDebugVariable variable;
53+ variable. name = " value " ;
54+ variable. declarationAstID = 23 ;
55+ variable. declarationLocation = SourceLocation{ 1 , 6 , std::make_shared<std::string>( " input.sol " )};
56+ variable. typeID = " type:uint256 " ;
57+ variable. ethdebugType = ethdebugType;
58+ variable .location = location;
59+ variable. ethdebugPointer = ethdebugPointer;
60+
61+ SemanticDebugData data;
62+ data. lexicalScopeID = 17 ;
63+ data. variableDefinitions . emplace_back ( std::move (variable));
64+ auto semanticDebugData = std::make_shared<SemanticDebugData const >( std::move (data) );
6565
6666 auto debugData = DebugData::create (
6767 SourceLocation{},
@@ -98,9 +98,9 @@ BOOST_AUTO_TEST_CASE(carries_semantic_debug_data)
9898
9999BOOST_AUTO_TEST_CASE (semantic_debug_data_table_uses_ast_id)
100100{
101- auto semanticDebugData = std::make_shared< SemanticDebugData const >(SemanticDebugData{
102- .lexicalScopeID = 17
103- } );
101+ SemanticDebugData data;
102+ data .lexicalScopeID = 17 ;
103+ auto semanticDebugData = std::make_shared<SemanticDebugData const >( std::move (data) );
104104
105105 SemanticDebugDataTable table;
106106 BOOST_CHECK (table.empty ());
0 commit comments