This is one for the C++ experts.

My understanding of the issue is that when the EV_TokenId typedef is expanded, the resulting E_TokenId part is ambiguous. Therefore, fully specifying the E_TokenId fixes the problem.

The kind of warning that is fixed by this patch is:

/source/libo/libo/autodoc/source/parser_i/idl/tk_keyw.cxx:110:29: error: no function template matches function template specialization 'Values_' TokBuiltInType::EV_TokenId::Values_() { return G_aTokBuiltInType_EV_TokenId_Values; }


(Please keep me on CC as I am not subscribed to this list).


regards,

-kris.
>From a1a529f98c8a8480c172cbb341ffd4847f6baf52 Mon Sep 17 00:00:00 2001
From: Kristian Rietveld <k...@lanedo.com>
Date: Sat, 22 Oct 2011 09:38:42 +0200
Subject: [PATCH 1/8] Match the correct function template specialization

Fully specify the E_TokenId type instead of relying on the EV_TokenId
typedef.
---
 autodoc/source/parser_i/idl/tk_keyw.cxx   |   10 +++++-----
 autodoc/source/parser_i/idl/tk_punct.cxx  |    2 +-
 autodoc/source/parser_i/idoc/tk_atag2.cxx |    2 +-
 autodoc/source/parser_i/idoc/tk_xml.cxx   |    6 +++---
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/autodoc/source/parser_i/idl/tk_keyw.cxx 
b/autodoc/source/parser_i/idl/tk_keyw.cxx
index 408f83d..dd84301 100644
--- a/autodoc/source/parser_i/idl/tk_keyw.cxx
+++ b/autodoc/source/parser_i/idl/tk_keyw.cxx
@@ -107,15 +107,15 @@ namespace lux
 {
 
 template<> EnumValueMap &
-TokBuiltInType::EV_TokenId::Values_()       { return 
G_aTokBuiltInType_EV_TokenId_Values; }
+Enum<TokBuiltInType::E_TokenId>::Values_()       { return 
G_aTokBuiltInType_EV_TokenId_Values; }
 template<> EnumValueMap &
-TokTypeModifier::EV_TokenId::Values_()      { return 
G_aTokTypeModifier_EV_TokenId_Values; }
+Enum<TokTypeModifier::E_TokenId>::Values_()      { return 
G_aTokTypeModifier_EV_TokenId_Values; }
 template<> EnumValueMap &
-TokMetaType::EV_TokenId::Values_()          { return 
G_aTokMetaType_EV_TokenId_Values; }
+Enum<TokMetaType::E_TokenId>::Values_()          { return 
G_aTokMetaType_EV_TokenId_Values; }
 template<> EnumValueMap &
-TokStereotype::EV_TokenId::Values_()        { return 
G_aTokStereotype_EV_TokenId_Values; }
+Enum<TokStereotype::E_TokenId>::Values_()        { return 
G_aTokStereotype_EV_TokenId_Values; }
 template<> EnumValueMap &
-TokParameterHandling::EV_TokenId::Values_() { return 
G_aTokParameterHandling_EV_TokenId_Values; }
+Enum<TokParameterHandling::E_TokenId>::Values_() { return 
G_aTokParameterHandling_EV_TokenId_Values; }
 
 }   // namespace lux
 
diff --git a/autodoc/source/parser_i/idl/tk_punct.cxx 
b/autodoc/source/parser_i/idl/tk_punct.cxx
index e617473..f1a8680 100644
--- a/autodoc/source/parser_i/idl/tk_punct.cxx
+++ b/autodoc/source/parser_i/idl/tk_punct.cxx
@@ -61,7 +61,7 @@ TokPunctuation::EV_TokenId  
Greater(TokPunctuation::Greater,">");
 namespace lux
 {
 template<> EnumValueMap &
-TokPunctuation::EV_TokenId::Values_()       { return 
G_aTokPunctuation_EV_TokenId_Values; }
+Enum<TokPunctuation::E_TokenId>::Values_()       { return 
G_aTokPunctuation_EV_TokenId_Values; }
 }
 
 
diff --git a/autodoc/source/parser_i/idoc/tk_atag2.cxx 
b/autodoc/source/parser_i/idoc/tk_atag2.cxx
index 30264f6..4e0022b 100644
--- a/autodoc/source/parser_i/idoc/tk_atag2.cxx
+++ b/autodoc/source/parser_i/idoc/tk_atag2.cxx
@@ -58,7 +58,7 @@ Tok_AtTag::EV_TokenId ev_since(Tok_AtTag::since,"@since");
 namespace lux
 {
 template<> EnumValueMap &
-Tok_AtTag::EV_TokenId::Values_()    { return G_aTokAtTag_EV_TokenId_Values; }
+Enum<Tok_AtTag::E_TokenId>::Values_()    { return 
G_aTokAtTag_EV_TokenId_Values; }
 }
 
 
diff --git a/autodoc/source/parser_i/idoc/tk_xml.cxx 
b/autodoc/source/parser_i/idoc/tk_xml.cxx
index a1f60d0..c4cc9ce 100644
--- a/autodoc/source/parser_i/idoc/tk_xml.cxx
+++ b/autodoc/source/parser_i/idoc/tk_xml.cxx
@@ -62,11 +62,11 @@ namespace lux
 {
 
 template<> EnumValueMap &
-Tok_XmlConst::EV_TokenId::Values_()         { return 
G_aTok_XmlConst_EV_TokenId_Values; }
+Enum<Tok_XmlConst::E_TokenId>::Values_()         { return 
G_aTok_XmlConst_EV_TokenId_Values; }
 template<> EnumValueMap &
-Tok_XmlLink_Tag::EV_TokenId::Values_()      { return 
G_aTok_XmlLink_Tag_EV_TokenId_Values; }
+Enum<Tok_XmlLink_Tag::E_TokenId>::Values_()      { return 
G_aTok_XmlLink_Tag_EV_TokenId_Values; }
 template<> EnumValueMap &
-Tok_XmlFormat_Tag::EV_TokenId::Values_()    { return 
G_aTok_XmlFormat_Tag_EV_TokenId_Values; }
+Enum<Tok_XmlFormat_Tag::E_TokenId>::Values_()    { return 
G_aTok_XmlFormat_Tag_EV_TokenId_Values; }
 
 }   // namespace lux
 
-- 
1.7.4.4

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to