Bad code in src/terminal/parser/ft_fuzzer/fuzzing_directed.h #17927

Open
opened 2026-01-31 05:58:46 +00:00 by claunia · 0 comments
Owner

Originally created by @JonCavesMSFT on GitHub (Jul 14, 2022).

Windows Terminal version

No response

Windows build number

No response

Other Software

No response

Steps to reproduce

The code in question is on line 965:

return (this->m_fFuzzed) ? &(this->m_t) : &CFuzzType<_Type, _Args...>::m_tInit;

The Visual C++ compiler is correctly rejecting this code for two reasons: 1) the non-static data member 'm_tInit' is protected so the attempt to create the pointer-to-member will fail; and 2) even if it succeeds there is no way the compiler can bring the types associated with the left and right expressions of the ':' operator to a common type. I suspect that the code should be:

return (this->m_fFuzzed) ? &(this->m_t) : &(this->m_tInit);

Thanks
JonCaves

Expected Behavior

No response

Actual Behavior

The code fails to compile with a recent build of the Visual C++ compiler

Originally created by @JonCavesMSFT on GitHub (Jul 14, 2022). ### Windows Terminal version _No response_ ### Windows build number _No response_ ### Other Software _No response_ ### Steps to reproduce The code in question is on line 965: `return (this->m_fFuzzed) ? &(this->m_t) : &CFuzzType<_Type, _Args...>::m_tInit;` The Visual C++ compiler is correctly rejecting this code for two reasons: 1) the non-static data member '`m_tInit`' is protected so the attempt to create the pointer-to-member will fail; and 2) even if it succeeds there is no way the compiler can bring the types associated with the left and right expressions of the '`:`' operator to a common type. I suspect that the code should be: `return (this->m_fFuzzed) ? &(this->m_t) : &(this->m_tInit);` Thanks JonCaves ### Expected Behavior _No response_ ### Actual Behavior The code fails to compile with a recent build of the Visual C++ compiler
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17927