Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332884 - Parser fails to deduce argument type in situation involving heavy template use
Summary: Parser fails to deduce argument type in situation involving heavy template use
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-18 02:46 EST by Nathan Ridge CLA
Modified: 2010-12-23 10:23 EST (History)
2 users (show)

See Also:


Attachments
source file that reproduces the error (431 bytes, application/octet-stream)
2010-12-18 02:46 EST, Nathan Ridge CLA
no flags Details
header file included by source file that reproduces the error (769 bytes, text/plain)
2010-12-18 02:48 EST, Nathan Ridge CLA
no flags Details
testcase + fix (7.84 KB, patch)
2010-12-23 10:15 EST, Markus Schorn CLA
mschorn.eclipse: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Ridge CLA 2010-12-18 02:46:46 EST
Created attachment 185471 [details]
source file that reproduces the error

For the code in the attached files (test.cpp and test.hpp), the parser gives the following error at the call to a.f(0) in main() in test.cpp:

Invalid arguments Candidates are: void f(?)

The "?" leads me to believe the parser is unable to deduce the type of the argument of f.

Interestingly, any of a number of small changes to the code cause the error to go away. Some of these are:

1. pasting the contents of test.hpp into test.cpp instead of including test.hpp (this one is very suspicious - this shouldn't make a difference at all, should it?)

2. removing the "enclosing" class in test.hpp and putting its contents in namespace scope instead

3. making the "enclosing" class in test.hpp not a template
Comment 1 Nathan Ridge CLA 2010-12-18 02:48:28 EST
Created attachment 185472 [details]
header file included by source file that reproduces the error
Comment 2 Markus Schorn CLA 2010-12-23 10:15:48 EST
Created attachment 185774 [details]
testcase + fix

Thanks for assembling the test case!
Comment 3 Markus Schorn CLA 2010-12-23 10:18:13 EST
Fixed in 8.0 > 20101223.