[cfe-dev] Combining floatLiteral() Node Matcher with isExpansionInFileMatching() Narrowing Matcher provides unexpected results

FarSight Studios via cfe-dev cfe-dev at lists.llvm.org
Wed Jan 9 06:15:28 PST 2019


Hi,

Combining floatLiteral() Node Matcher with isExpansionInFileMatching()
Narrowing Matcher provides unexpected results.
The following matcher:
floatLiteral(isExpansionInFileMatching("include/math.h"))
does not matches "M_E" which is defined in "math.h"

#include <math.h>

int consts(int n){
    double varX = M_E;
    return varX;
}

It matches a single unrelated node:
FloatingLiteral 0x562c409bdaa8 </usr/include/math.h:1184:47> 'float'
0.000000e+00

Am I doing something wrong?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190109/91e417d3/attachment.html>


More information about the cfe-dev mailing list