Details
Diff Detail
Unit Tests
Event Timeline
clang/test/AST/Interp/literals.cpp | ||
---|---|---|
783 | Can we add tests for each predefined expressions, it does not look like there are a lot of them. |
clang/test/AST/Interp/literals.cpp | ||
---|---|---|
783 | Not sure that adds much value? Didn't the output of __PRETTY_FUNCTION__ change at some point in the last release even, which would make this test brittle? |
clang/test/AST/Interp/literals.cpp | ||
---|---|---|
783 | The behavior doesn't change all that often and we should test that we get the expected results from each of the expressions. It should be straightforward: https://godbolt.org/z/qveWPGWjK |
clang/test/AST/Interp/literals.cpp | ||
---|---|---|
783 | Oh well if you provide the test cases as well, that's of course a completely different situation :) |
clang/test/AST/Interp/literals.cpp | ||
---|---|---|
797 | You should add coverage for the others as well: enum IdentKind { Func, Function, LFunction, // Same as Function, but as wide string. FuncDName, FuncSig, LFuncSig, // Same as FuncSig, but as wide string PrettyFunction, /// The same as PrettyFunction, except that the /// 'virtual' keyword is omitted for virtual member functions. PrettyFunctionNoVirtual }; (you can handle the wide string variants by making strings_match into a template.) |
clang/test/AST/Interp/literals.cpp | ||
---|---|---|
797 | These don't seem to exist in C++14 onwards: array.cpp:1238:33: error: use of undeclared identifier '__FUNCDNAME__' 1238 | static_assert(strings_match(__FUNCDNAME__, "foo"), ""); | ^ array.cpp:1239:33: error: use of undeclared identifier '__FUNCSIG__' 1239 | static_assert(strings_match(__FUNCSIG__, "foo"), ""); | ^ array.cpp:1240:33: error: use of undeclared identifier '__LFUNCSIG__' 1240 | static_assert(strings_match(__LFUNCSIG__, "foo"), ""); | ^ array.cpp:1241:33: error: use of undeclared identifier '__LFUNCTION__' 1241 | static_assert(strings_match(__LFUNCTION__, "foo"), ""); | ^ array.cpp:1244:33: error: use of undeclared identifier '__PRETTY_FUNCTION_NO_VIRTUAL__' 1244 | static_assert(strings_match(__PRETTY_FUNCTION_NO_VIRTUAL__, "void PredefinedExprs::foo()"), ""); | ^ 5 errors generated. ... but I can't use a while loop (or any kind of loop, I think?) before C++14 :) | |
797 | e |
clang/test/AST/Interp/literals.cpp | ||
---|---|---|
797 | They exist, but you need to enable -fms-extensions for them: https://godbolt.org/z/E94snrMd9 |
LGTM with a caution about testing the mangled signature (you can fix that up when landing though).
clang/test/AST/Interp/literals.cpp | ||
---|---|---|
796 | I suspect this will pass for you on one ABI but fail on another due to mangling differences. You might need to specify an ABI on the RUN lines to account for that. |
Can we add tests for each predefined expressions, it does not look like there are a lot of them.