sammycage / lunasvg

lunasvg is a standalone SVG rendering library in C++
MIT License
818 stars 115 forks source link

rename inner selector in seletor to subselector #147

Closed toge closed 7 months ago

toge commented 7 months ago

Thank you for relaxing compiler requirements on lunasvg/2.3.9.

I met compilation error on gcc 5.4.0.

source/parser.cpp: In static member function ‘static bool lunasvg::RuleData::matchPseudoClassSelector(const lunasvg::PseudoClassSelector&, const lunasvg::Element*)’:
source/parser.cpp:1229:30: error: use of ‘selector’ before deduction of ‘auto’
         for(auto& selector : selector.subSelectors) {
                              ^
source/parser.cpp:1230:29: error: unable to deduce ‘auto&&’ from ‘selector’
             for(auto& sel : selector) {
                             ^
source/parser.cpp:1241:30: error: use of ‘selector’ before deduction of ‘auto’
         for(auto& selector : selector.subSelectors) {
                              ^
source/parser.cpp:1242:29: error: unable to deduce ‘auto&&’ from ‘selector’
             for(auto& sel : selector) {
                             ^

Those errors are caused by same symbol name in for loops. If possible, woudl you merge this PR to work well on old gcc compilers.

sammycage commented 7 months ago

Thank you 🎉🎉🎉