--- synopsis-0.8.0.org/tests/Parsers/Cxx/expected/const.xml	1970-01-01 01:00:00.000000000 +0100
+++ synopsis-0.8.0/tests/Parsers/Cxx/expected/const.xml	2006-01-23 22:30:57.000000000 +0100
@@ -0,0 +1,45 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<ast>
+ <declarations>
+  <instance accessibility="0" class="Synopsis.AST.Class" file="Parsers/Cxx/input/const.cc" language="C++" line="2" name="constFoo" type="class">
+   <declarations>
+    <instance accessibility="1" class="Synopsis.AST.Operation" file="Parsers/Cxx/input/const.cc" language="C++" line="4" name="constFoo.constMethod(int)const" realname="constMethod" type="member function">
+     <parameters>
+      <instance class="Synopsis.AST.Parameter" identifier="param" value="">
+       <type>
+        <instance class="Synopsis.Type.Base" language="C++" name="int"/>
+       </type>
+      </instance>
+     </parameters>
+     <postmodifier>
+      const
+     </postmodifier>
+     <premodifier>
+      virtual
+     </premodifier>
+     <returnType>
+      <instance class="Synopsis.Type.Base" language="C++" name="void"/>
+     </returnType>
+    </instance>
+    <instance accessibility="1" class="Synopsis.AST.Builtin" file="Parsers/Cxx/input/const.cc" language="C++" line="4" name="EOS" type="EOS"/>
+   </declarations>
+  </instance>
+ </declarations>
+ <types>
+  <instance class="Synopsis.Type.Declared" language="C++" name="EOS">
+   <declaration/>
+  </instance>
+  <instance class="Synopsis.Type.Declared" language="C++" name="constFoo">
+   <declaration/>
+  </instance>
+  <instance class="Synopsis.Type.Declared" language="C++" name="constFoo.constMethod(int)const">
+   <declaration/>
+  </instance>
+ </types>
+ <files>
+  <instance class="Synopsis.AST.SourceFile" filename="Parsers/Cxx/input/const.cc" is_main="1" language="C++">
+   <declarations/>
+   <macro_calls/>
+  </instance>
+ </files>
+</ast>
--- synopsis-0.8.0.org/tests/Parsers/Cxx/input/const.cc	1970-01-01 01:00:00.000000000 +0100
+++ synopsis-0.8.0/tests/Parsers/Cxx/input/const.cc	2006-01-15 18:47:54.000000000 +0100
@@ -0,0 +1,6 @@
+
+class constFoo {
+public:
+	virtual void constMethod(int param) const;
+};
+
--- synopsis-0.8.0.org/Synopsis/AST.py	2005-06-04 21:48:12.000000000 +0200
+++ synopsis-0.8.0/Synopsis/AST.py	2006-01-23 22:08:07.000000000 +0100
@@ -576,13 +576,13 @@
    Note that function names are stored in mangled form to allow overriding.
    Formatters should use the realname() method to extract the unmangled name."""
 
-   def __init__(self, file, line, language, type, premod, returnType, name, realname):
+   def __init__(self, file, line, language, type, premod, returnType, postmod, name, realname):
       Declaration.__init__(self, file, line, language, type, name)
       self.__realname = realname
       self.__premodifier = premod
       self.__returnType = returnType
       self.__parameters = []
-      self.__postmodifier = []
+      self.__postmodifier = postmod
       self.__exceptions = []
       self.__template = None
    def premodifier(self):
@@ -623,8 +623,8 @@
    """Operation class. An operation is related to a Function and is currently
    identical.
    """
-   def __init__(self, file, line, language, type, premod, returnType, name, realname):
-      Function.__init__(self, file, line, language, type, premod, returnType, name, realname)
+   def __init__(self, file, line, language, type, premod, returnType, postmod, name, realname):
+      Function.__init__(self, file, line, language, type, premod, returnType, postmod, name, realname)
    def accept(self, visitor): visitor.visitOperation(self)
 
 class CommentTag:
--- synopsis-0.8.0.org/Synopsis/Parsers/Cxx/syn/builder.cc	2005-05-13 06:16:16.000000000 +0200
+++ synopsis-0.8.0/Synopsis/Parsers/Cxx/syn/builder.cc	2006-01-22 21:59:31.000000000 +0100
@@ -562,6 +562,7 @@
 //. Add an function
 AST::Function* Builder::add_function(int line, const std::string& name,
                                      const std::vector<std::string>& premod, Types::Type* ret,
+                                     const std::vector<std::string>& postmod,
                                      const std::string& realname, AST::Parameter::vector* templ_params)
 {
     // Find the parent scope, depending on whether this is a template or not
@@ -578,9 +579,9 @@
     // function
     AST::Function* func;
     if (dynamic_cast<AST::Class*>(parent_scope))
-        func = new AST::Operation(m_file, line, "member function", func_name, premod, ret, realname);
+        func = new AST::Operation(m_file, line, "member function", func_name, premod, ret, postmod, realname);
     else
-        func = new AST::Function(m_file, line, "function", func_name, premod, ret, realname);
+        func = new AST::Function(m_file, line, "function", func_name, premod, ret, postmod, realname);
 
     // Create template type
     if (templ_params)
--- synopsis-0.8.0.org/Synopsis/Parsers/Cxx/syn/builder.hh	2005-05-13 06:16:16.000000000 +0200
+++ synopsis-0.8.0/Synopsis/Parsers/Cxx/syn/builder.hh	2006-01-22 21:52:37.000000000 +0100
@@ -182,6 +182,7 @@
     //. Add an function
     AST::Function* add_function(int, const std::string& name,
                                 const std::vector<std::string>& premod, Types::Type* ret,
+                                const std::vector<std::string>& postmod,
                                 const std::string& realname, AST::Parameter::vector* templ_params);
 
     //. Add a variable
--- synopsis-0.8.0.org/Synopsis/Parsers/Cxx/syn/ast.cc	2005-05-13 06:16:16.000000000 +0200
+++ synopsis-0.8.0/Synopsis/Parsers/Cxx/syn/ast.cc	2006-01-22 21:56:37.000000000 +0100
@@ -338,9 +338,9 @@
 
 Function::Function(
     SourceFile* file, int line, const std::string& type, const ScopedName& name,
-    const Mods& premod, Types::Type* ret, const std::string& realname
+    const Mods& premod, Types::Type* ret, const Mods& postmod, const std::string& realname
 )
-        : Declaration(file, line, type, name), m_pre(premod), m_ret(ret),
+        : Declaration(file, line, type, name), m_pre(premod), m_ret(ret), m_post(postmod),
         m_realname(realname), m_template(0)
 {}
 
@@ -360,9 +360,9 @@
 
 Operation::Operation(
     SourceFile* file, int line, const std::string& type, const ScopedName& name,
-    const Mods& premod, Types::Type* ret, const std::string& realname
+    const Mods& premod, Types::Type* ret, const Mods& postmod, const std::string& realname
 )
-        : Function(file, line, type, name, premod, ret, realname)
+        : Function(file, line, type, name, premod, ret, postmod, realname)
 { }
 
 void
--- synopsis-0.8.0.org/Synopsis/Parsers/Cxx/syn/ast.hh	2005-05-13 06:16:16.000000000 +0200
+++ synopsis-0.8.0/Synopsis/Parsers/Cxx/syn/ast.hh	2006-01-22 22:05:14.000000000 +0100
@@ -944,7 +944,7 @@
     //. Constructor
     Function(
         SourceFile* file, int line, const std::string& type, const ScopedName& name,
-        const Mods& premod, Types::Type* ret, const std::string& realname
+        const Mods& premod, Types::Type* ret, const Mods& postmod, const std::string& realname
     );
 
     //. Destructor. Recursively destroys parameters
@@ -963,6 +963,12 @@
         return m_pre;
     }
 
+    //. Returns the postmodifier vector
+    Mods& postmodifier()
+    {
+        return m_post;
+    }
+
     //. Returns the return Type
     Types::Type* return_type()
     {
@@ -993,8 +999,8 @@
         m_template = type;
     }
 private:
-    //. The premodifier vector
-    Mods              m_pre;
+    //. The pre- and postmodifier vector
+    Mods              m_pre, m_post;
     //. The return type
     Types::Type*      m_ret;
     //. The real (unmangled) name
@@ -1011,7 +1017,8 @@
 {
 public:
     //. Constructor
-    Operation(SourceFile* file, int line, const std::string& type, const ScopedName& name, const Mods& modifiers, Types::Type* ret, const std::string& realname);
+    Operation(SourceFile* file, int line, const std::string& type, const ScopedName& name, 
+              const Mods& modifiers, Types::Type* ret, const Mods& post_modifiers, const std::string& realname);
 
     //. Accept the given visitor
     virtual void
--- synopsis-0.8.0.org/Synopsis/Parsers/Cxx/syn/Translator.cc	2005-06-04 21:49:03.000000000 +0200
+++ synopsis-0.8.0/Synopsis/Parsers/Cxx/syn/Translator.cc	2006-01-22 22:15:54.000000000 +0100
@@ -851,11 +851,11 @@
 PyObject *Translator::Function(AST::Function* decl)
 {
   Trace trace("Translator::addFunction", Trace::TRANSLATION);
-  PyObject *func, *file, *type, *name, *pre, *ret, *realname;
-  func = PyObject_CallMethod(m_ast_module, "Function", "OiOOOOOO",
+  PyObject *func, *file, *type, *name, *pre, *ret, *post, *realname;
+  func = PyObject_CallMethod(m_ast_module, "Function", "OiOOOOOOO",
                              file = m->py(decl->file()), decl->line(), m->cxx(),
                              type = m->py(decl->type()), pre = m->List(decl->premodifier()),
-                             ret = m->py(decl->return_type()),
+                             ret = m->py(decl->return_type()),  post = m->List(decl->postmodifier()),
                              name = m->Tuple(decl->name()), realname = m->py(decl->realname()));
   // This is necessary to prevent inf. loops in several places
   m->add(decl, func);
@@ -874,6 +874,7 @@
   Py_DECREF(name);
   Py_DECREF(pre);
   Py_DECREF(ret);
+  Py_DECREF(post);
   Py_DECREF(realname);
   Py_DECREF(params);
   Py_DECREF(new_params);
@@ -883,11 +884,11 @@
 PyObject *Translator::Operation(AST::Operation* decl)
 {
   Trace trace("Translator::addOperation", Trace::TRANSLATION);
-  PyObject *oper, *file, *type, *name, *pre, *ret, *realname;
-  oper = PyObject_CallMethod(m_ast_module, "Operation", "OiOOOOOO",
+  PyObject *oper, *file, *type, *name, *pre, *ret, *post, *realname;
+  oper = PyObject_CallMethod(m_ast_module, "Operation", "OiOOOOOOO",
                              file = m->py(decl->file()), decl->line(), m->cxx(),
                              type = m->py(decl->type()), pre = m->List(decl->premodifier()),
-                             ret = m->py(decl->return_type()),
+                             ret = m->py(decl->return_type()), post = m->List(decl->postmodifier()),
                              name = m->Tuple(decl->name()), realname = m->py(decl->realname()));
   // This is necessary to prevent inf. loops in several places
   m->add(decl, oper);
@@ -906,6 +907,7 @@
   Py_DECREF(name);
   Py_DECREF(pre);
   Py_DECREF(ret);
+  Py_DECREF(post);
   Py_DECREF(realname);
   Py_DECREF(params);
   Py_DECREF(new_params);
--- synopsis-0.8.0.org/Synopsis/Parsers/Cxx/syn/swalker.cc	2005-06-02 16:22:58.000000000 +0200
+++ synopsis-0.8.0/Synopsis/Parsers/Cxx/syn/swalker.cc	2006-01-23 22:20:01.000000000 +0100
@@ -1087,9 +1087,16 @@
     // Name is same as realname, but with parameters added
     std::string name = realname + format_parameters(params);
     // Append const after params if this is a const function
-    if (is_const) name += "const";
+  
+    // Figure out postmodifiers
+    std::vector<std::string> postmod;
+    if (is_const) {
+	    name += "const";
+	    postmod.push_back("const");
+    }
+
     // Create AST::Function object
-    func = my_builder->add_function(my_lineno, name, premod, returnType, realname, is_template);
+    func = my_builder->add_function(my_lineno, name, premod, returnType, postmod, realname, is_template);
     func->parameters() = params;
   }
   add_comments(func, my_declaration);
