File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
cpp/misra/src/rules/RULE-28-6-1 Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1717import cpp
1818import codingstandards.cpp.standardlibrary.Utility
1919import codingstandards.cpp.ast.ValueCategory
20- import codingstandards.cpp.types.Resolve
21- import codingstandards.cpp.types.Specifiers
20+
21+ predicate resolvesToConstOrConstRef ( Type t ) {
22+ t .isConst ( )
23+ or
24+ resolvesToConstOrConstRef ( t .( ReferenceType ) .getBaseType ( ) )
25+ or
26+ resolvesToConstOrConstRef ( t .( TypedefType ) .getBaseType ( ) )
27+ or
28+ resolvesToConstOrConstRef ( t .( Decltype ) .getBaseType ( ) )
29+ }
2230
2331predicate isConstLvalue ( Expr arg ) {
2432 getValueCategory ( arg ) .isLValue ( ) and
25- arg .getType ( ) instanceof ResolvesTo < RawConstType > :: ExactlyOrRef
33+ resolvesToConstOrConstRef ( arg .getType ( ) )
2634}
2735
2836Type typeOfArgument ( Expr e ) {
You can’t perform that action at this time.
0 commit comments