| Summary: | [fp] "Invalid arguments" from failing to evaluate default arguments | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Josh Kelley <joshkel> |
| Component: | cdt-codan | Assignee: | CDT Codan Inbox <cdt-codan-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | Elena Laskavaia <elaskavaia.cdt> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug, malaperle, yevshif, zeratul976 |
| Version: | 8.1.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
Your example works fine for me with CDT 8.2 (Kepler). Works for me as well. Please reopen the bug if you can reproduce with Kepler. |
Build Identifier: Version: Indigo Service Release 1 Build id: 20110916-0149 I'm getting an "Invalid arguments" error from code analysis for code similar to the following: test.h: #ifndef TESTH #define TESTH #include <time.h> void HandleException(const std::exception& e, const char *NULL); void ProcessItem(const char *directory, time_t timestamp = time(NULL)); #endif test.cpp: #include <test.h> int main(int, char**) { try { ProcessItem("."); } catch (std::exception& e) { HandleException(e); } } Both the ProcessItem call and the HandleException call generate "Invalid arguments" errors, as if the code analysis fails to consider the default arguments. If I explicitly pass the last argument, then the code works. This happens every time I use two particular functions in my application code, although so far, I've been unable to reproduce it in standalone test code. I've tried rebuilding the indexes, but that hasn't helped. This is possibly related to #356011 (which also could not be reproduced). Reproducible: Sometimes