@@ -1589,19 +1589,19 @@ static QCString stripDeclKeywords(const QCString &s)
1589
1589
}
1590
1590
1591
1591
// forward decl for circular dependencies
1592
- static QCString extractCanonicalType (const Definition *d,const FileDef *fs,QCString type);
1592
+ static QCString extractCanonicalType (const Definition *d,const FileDef *fs,QCString type,SrcLangExt lang );
1593
1593
1594
- QCString getCanonicalTemplateSpec (const Definition *d,const FileDef *fs,const QCString& spec)
1594
+ static QCString getCanonicalTemplateSpec (const Definition *d,const FileDef *fs,const QCString& spec,SrcLangExt lang )
1595
1595
{
1596
1596
1597
1597
QCString templSpec = spec.stripWhiteSpace ();
1598
1598
// this part had been commented out before... but it is needed to match for instance
1599
1599
// std::list<std::string> against list<string> so it is now back again!
1600
1600
if (!templSpec.isEmpty () && templSpec.at (0 ) == ' <' )
1601
1601
{
1602
- templSpec = " < " + extractCanonicalType (d,fs,templSpec.right (templSpec.length ()-1 ).stripWhiteSpace ());
1602
+ templSpec = " < " + extractCanonicalType (d,fs,templSpec.right (templSpec.length ()-1 ).stripWhiteSpace (),lang );
1603
1603
}
1604
- QCString resolvedType = resolveTypeDef (d,templSpec);
1604
+ QCString resolvedType = lang==SrcLangExt_Java ? templSpec : resolveTypeDef (d,templSpec);
1605
1605
if (!resolvedType.isEmpty ()) // not known as a typedef either
1606
1606
{
1607
1607
templSpec = resolvedType;
@@ -1612,14 +1612,14 @@ QCString getCanonicalTemplateSpec(const Definition *d,const FileDef *fs,const QC
1612
1612
1613
1613
1614
1614
static QCString getCanonicalTypeForIdentifier (
1615
- const Definition *d,const FileDef *fs,const QCString &word,
1615
+ const Definition *d,const FileDef *fs,const QCString &word,SrcLangExt lang,
1616
1616
QCString *tSpec,int count=0 )
1617
1617
{
1618
1618
if (count>10 ) return word; // oops recursion
1619
1619
1620
1620
QCString symName,result,templSpec,tmpName;
1621
1621
if (tSpec && !tSpec->isEmpty ())
1622
- templSpec = stripDeclKeywords (getCanonicalTemplateSpec (d,fs,*tSpec));
1622
+ templSpec = stripDeclKeywords (getCanonicalTemplateSpec (d,fs,*tSpec,lang ));
1623
1623
1624
1624
if (word.findRev (" ::" )!=-1 && !(tmpName=stripScope (word)).isEmpty ())
1625
1625
{
@@ -1691,7 +1691,7 @@ static QCString getCanonicalTypeForIdentifier(
1691
1691
else if (!ts.isEmpty () && templSpec.isEmpty ())
1692
1692
{
1693
1693
// use formal template args for spec
1694
- templSpec = stripDeclKeywords (getCanonicalTemplateSpec (d,fs,ts));
1694
+ templSpec = stripDeclKeywords (getCanonicalTemplateSpec (d,fs,ts,lang ));
1695
1695
}
1696
1696
1697
1697
result = removeRedundantWhiteSpace (cd->qualifiedName () + templSpec);
@@ -1734,7 +1734,7 @@ static QCString getCanonicalTypeForIdentifier(
1734
1734
type.stripPrefix (" typename " );
1735
1735
type = stripTemplateSpecifiersFromScope (type,FALSE );
1736
1736
}
1737
- result = getCanonicalTypeForIdentifier (d,fs,type,tSpec,count+1 );
1737
+ result = getCanonicalTypeForIdentifier (d,fs,type,mType -> getLanguage (), tSpec,count+1 );
1738
1738
}
1739
1739
else
1740
1740
{
@@ -1743,7 +1743,7 @@ static QCString getCanonicalTypeForIdentifier(
1743
1743
}
1744
1744
else // fallback
1745
1745
{
1746
- resolvedType = resolveTypeDef (d,word);
1746
+ resolvedType = lang==SrcLangExt_Java ? word : resolveTypeDef (d,word);
1747
1747
// printf("typedef [%s]->[%s]\n",qPrint(word),qPrint(resolvedType));
1748
1748
if (resolvedType.isEmpty ()) // not known as a typedef either
1749
1749
{
@@ -1758,7 +1758,7 @@ static QCString getCanonicalTypeForIdentifier(
1758
1758
return result;
1759
1759
}
1760
1760
1761
- static QCString extractCanonicalType (const Definition *d,const FileDef *fs,QCString type)
1761
+ static QCString extractCanonicalType (const Definition *d,const FileDef *fs,QCString type,SrcLangExt lang )
1762
1762
{
1763
1763
type = type.stripWhiteSpace ();
1764
1764
@@ -1785,7 +1785,7 @@ static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCStr
1785
1785
// printf(" i=%d p=%d\n",i,p);
1786
1786
if (i>pp) canType += type.mid (pp,i-pp);
1787
1787
1788
- QCString ct = getCanonicalTypeForIdentifier (d,fs,word,&templSpec);
1788
+ QCString ct = getCanonicalTypeForIdentifier (d,fs,word,lang, &templSpec);
1789
1789
1790
1790
// in case the ct is empty it means that "word" represents scope "d"
1791
1791
// and this does not need to be added to the canonical
@@ -1819,7 +1819,7 @@ static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCStr
1819
1819
size_t tl = match.length ();
1820
1820
std::string matchStr = match.str ();
1821
1821
canType += ts.substr (tp,ti-tp);
1822
- canType += getCanonicalTypeForIdentifier (d,fs,matchStr.c_str (),0 );
1822
+ canType += getCanonicalTypeForIdentifier (d,fs,matchStr.c_str (),lang, 0 );
1823
1823
tp=ti+tl;
1824
1824
}
1825
1825
canType+=ts.substr (tp);
@@ -1833,7 +1833,7 @@ static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCStr
1833
1833
return removeRedundantWhiteSpace (canType);
1834
1834
}
1835
1835
1836
- static QCString extractCanonicalArgType (const Definition *d,const FileDef *fs,const Argument &arg)
1836
+ static QCString extractCanonicalArgType (const Definition *d,const FileDef *fs,const Argument &arg,SrcLangExt lang )
1837
1837
{
1838
1838
QCString type = arg.type .stripWhiteSpace ();
1839
1839
QCString name = arg.name ;
@@ -1853,12 +1853,13 @@ static QCString extractCanonicalArgType(const Definition *d,const FileDef *fs,co
1853
1853
type+=arg.array ;
1854
1854
}
1855
1855
1856
- return extractCanonicalType (d,fs,type);
1856
+ return extractCanonicalType (d,fs,type,lang );
1857
1857
}
1858
1858
1859
1859
static bool matchArgument2 (
1860
1860
const Definition *srcScope,const FileDef *srcFileScope,Argument &srcA,
1861
- const Definition *dstScope,const FileDef *dstFileScope,Argument &dstA
1861
+ const Definition *dstScope,const FileDef *dstFileScope,Argument &dstA,
1862
+ SrcLangExt lang
1862
1863
)
1863
1864
{
1864
1865
// printf(">> match argument: %s::'%s|%s' (%s) <-> %s::'%s|%s' (%s)\n",
@@ -1896,8 +1897,8 @@ static bool matchArgument2(
1896
1897
if (srcA.canType .isEmpty () || dstA.canType .isEmpty ())
1897
1898
{
1898
1899
// need to re-evaluate both see issue #8370
1899
- srcA.canType = extractCanonicalArgType (srcScope,srcFileScope,srcA);
1900
- dstA.canType = extractCanonicalArgType (dstScope,dstFileScope,dstA);
1900
+ srcA.canType = extractCanonicalArgType (srcScope,srcFileScope,srcA,lang );
1901
+ dstA.canType = extractCanonicalArgType (dstScope,dstFileScope,dstA,lang );
1901
1902
}
1902
1903
1903
1904
if (srcA.canType ==dstA.canType )
@@ -1917,8 +1918,8 @@ static bool matchArgument2(
1917
1918
1918
1919
// new algorithm for argument matching
1919
1920
bool matchArguments2 (const Definition *srcScope,const FileDef *srcFileScope,const ArgumentList *srcAl,
1920
- const Definition *dstScope,const FileDef *dstFileScope,const ArgumentList *dstAl,
1921
- bool checkCV)
1921
+ const Definition *dstScope,const FileDef *dstFileScope,const ArgumentList *dstAl,
1922
+ bool checkCV,SrcLangExt lang )
1922
1923
{
1923
1924
ASSERT (srcScope!=0 && dstScope!=0 );
1924
1925
@@ -1990,7 +1991,8 @@ bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,cons
1990
1991
Argument &srcA = const_cast <Argument&>(*srcIt);
1991
1992
Argument &dstA = const_cast <Argument&>(*dstIt);
1992
1993
if (!matchArgument2 (srcScope,srcFileScope,srcA,
1993
- dstScope,dstFileScope,dstA)
1994
+ dstScope,dstFileScope,dstA,
1995
+ lang)
1994
1996
)
1995
1997
{
1996
1998
NOMATCH
@@ -2002,7 +2004,6 @@ bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,cons
2002
2004
}
2003
2005
2004
2006
2005
-
2006
2007
// merges the initializer of two argument lists
2007
2008
// pre: the types of the arguments in the list should match.
2008
2009
void mergeArguments (ArgumentList &srcAl,ArgumentList &dstAl,bool forceNameOverwrite)
@@ -2172,7 +2173,7 @@ static void findMembersWithSpecificName(const MemberName *mn,
2172
2173
match=matchArguments2 (
2173
2174
md->getOuterScope (),fd,&mdAl,
2174
2175
Doxygen::globalScope,fd,argList_p.get (),
2175
- checkCV);
2176
+ checkCV,md-> getLanguage () );
2176
2177
}
2177
2178
if (match)
2178
2179
{
@@ -2310,7 +2311,7 @@ bool getDefs(const QCString &scName,
2310
2311
bool match = args.isEmpty () ||
2311
2312
matchArguments2 (mmd->getOuterScope (),mmd->getFileDef (),&mmdAl,
2312
2313
fcd, fcd->getFileDef (),argList.get (),
2313
- checkCV);
2314
+ checkCV,mmd-> getLanguage () );
2314
2315
// printf("match=%d\n",match);
2315
2316
if (match)
2316
2317
{
@@ -2433,9 +2434,8 @@ bool getDefs(const QCString &scName,
2433
2434
2434
2435
const ArgumentList &mmdAl = mmd->argumentList ();
2435
2436
if (matchArguments2 (mmd->getOuterScope (),mmd->getFileDef (),&mmdAl,
2436
- Doxygen::globalScope,mmd->getFileDef (),argList.get (),
2437
- checkCV
2438
- )
2437
+ Doxygen::globalScope,mmd->getFileDef (),argList.get (),
2438
+ checkCV,mmd->getLanguage ())
2439
2439
)
2440
2440
{
2441
2441
fuzzy_mmd = mmd;
@@ -2520,7 +2520,7 @@ bool getDefs(const QCString &scName,
2520
2520
match=matchArguments2 (
2521
2521
mmd->getOuterScope (),mmd->getFileDef (),&mmdAl,
2522
2522
fnd,mmd->getFileDef (),argList_p.get (),
2523
- checkCV);
2523
+ checkCV,mmd-> getLanguage () );
2524
2524
}
2525
2525
if (match)
2526
2526
{
0 commit comments