Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356011

Summary: Function default argument isn't correctly parsed
Product: [Tools] CDT Reporter: cybek cybek <nomad.c4>
Component: cdt-parserAssignee: Project Inbox <cdt-parser-inbox>
Status: RESOLVED WORKSFORME QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description cybek cybek CLA 2011-08-27 17:54:57 EDT
Build Identifier: 8.0.0.201106081058

Hi. I have declaration of function in header:
void ShowText(int x, int y, const std::string &text, Uint32 color32=0);
and when i use this function like:
ShowText(10, 10, strCameraPos);
parsed say that there isn't any function ShowText with 3 parameters.

Invalid arguments ' Candidates are: void ShowText(int, int, const 
	 std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, unsigned int) '

Reproducible: Always

Steps to Reproduce:
1. Write in header void ShowText(int x, int y, const std::string &text, Uint32 color32=0);
2. Include header in cpp and try to use function like: 
char strCameraPos[128];
	sprintf(strCameraPos, "Camera: %dx%d", cameraX, cameraY);
	ShowText(10, 10, strCameraPos);
3. CDT show bug in this live with liveparser
Comment 1 Markus Schorn CLA 2011-09-07 02:43:05 EDT
I was not able to reproduce the problem. Do you also see it for the following code?
   #include "showtext.h"
   void test() {
      std::string x= "";
      ShowText(10, 10, x);
   }
Comment 2 cybek cybek CLA 2011-09-11 05:25:40 EDT
It looks like single error in CDT Indexer. I turned it off and applied. And again turned it on, and all is working good. Maybe some freeze in indexing or something.
Thanks for reply.
Comment 3 Markus Schorn CLA 2011-09-15 10:41:39 EDT
Please reopen the bugzilla, in case you can reproduce the issue.