Changeset f979f0ba


Ignore:
Timestamp:
Dec 12, 2024, 4:23:08 PM (6 days ago)
Author:
Fangren Yu <f37yu@…>
Branches:
master
Children:
35cc6d4
Parents:
532c0cd
Message:

suppress reference conversion warning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Lvalue.cpp

    r532c0cd rf979f0ba  
    313313                //   &__ref_tmp_2;
    314314                // The last & comes from the remaining reference conversion code.
    315                 SemanticWarning( expr->arg->location,
    316                         Warning::RvalueToReferenceConversion, toCString( expr->arg ) );
     315
    317316
    318317                // allowing conversion in the rvalue to const ref case
     
    320319                ast::Type const * targetType = dstType;
    321320                for (int i = 0; i < diff; ++i) targetType = (strict_dynamic_cast<ast::ReferenceType const *>(targetType))->base;
     321
     322                if (!targetType->qualifiers.is_const) {
     323                        SemanticWarning( expr->arg->location,
     324                                Warning::RvalueToReferenceConversion, toCString( expr->arg ) );
     325                }
    322326
    323327                static UniqueName tmpNamer( "__ref_tmp_" );
Note: See TracChangeset for help on using the changeset viewer.