ok, point is taken - means seems no bug with defining the overload for
But nevertheless something doesn't work:
here is what is done by semantic-tag-abstract-p-c-mode:
((eq (semantic-tag-class tag) 'function)
(semantic-tag-get-attribute tag :pure-virtual-flag))
Ok, when i put point onto the virtual method "aProctedMethod"
(line 8 in the following short c++-header-file klaus-test.hpp) then
(semantic-tag-attributes (semantic-current-tag)) returns
(:prototype-flag t :typemodifiers ("virtual") :type "void")
You see, there is no attribute :pure-virtual-flag contained in
the plist! So no one can be found and therefore in turn the
abstract-p check fails...
In cedet-beta2b we have the following situation:
(defun semantic-tag-abstract-p (tag &optional parent)
"Return non nil if TAG is abstract.
Optional PARENT is the parent tag of TAG.
In UML, abstract methods and classes have special meaning and behavior
in how methods are overridden. In UML, abstract methods are italicized.
The default behavior (if not overridden with `tag-abstract'
is to return true if `abstract' is in the type modifiers."
(let* ((s (or (semantic-fetch-overload 'tag-abstract)
(if s (funcall s tag parent)
(semantic-tag-abstract-p-default tag parent))))
You see that it checks if there is an overlaod for
'tag-abstract but in semantic-default-c-setup the override
is installed for 'tag-abstract-p. Note the missing -p suffix
in the check above... so in cedet beta2b the code runs always
in semantic-tag-abstract-p-default, the special
semantic-c-tag-abstract-p is never used. And the default
function return correctly t for virtual c++-methods whereas
the semantic-c-tag-abstract-p doesn't. So cedet beta2b works only
by accident correctly ;-)
Now in cedet beta3b the correct override functions seems to be used
(describe-mode-local-binding return the correct values)
but it doesn't do the correct job because it checks for
:pure-virtual-flag which is not in the p-attribute-list of
a function tag!
So, the problems is:
The abstract-check tests for :pure-virtual-flag but the parser seems
to to provide such a flag in the tag-attributes. What is the problem,
why this difference??
David PONCE wrote:
> Hi Klaus,
>> i think i have detected a serious bug in cedet beta3b...
>> It seems that the mode-local stuff has been completey redesigned
>> between cedet2b and cedet3b - in semantic-c.el now the macro
>> define-mode-local-override is used, e.g. for
>> semantic-tag-abstract-p. Well, this is not abug but IMHO defining
>> this for c-mode is a bug! Anyway in cedet2b this function works
>> whereas in cedetbeta3b it doesn't: If point stays onto a virtual
>> method in a c++-header-file then the following code fails in 3b (in
>> 2b it works):
>> (semantic-tag-abstract-p (semantic-current-tag)
>> Should this overloads not being defined for c++-mode instead of
>> c-mode - or even better for c-common-mode if an override should be
>> used for for all c-modes?! maybe the macro
>> define-mode-local-override (and subsequent stuff from mode-local.el)
>> should be designed to get a list of modes instead exactly one mode?!
> AFAIK, c++-mode is considered by semantic as derived from c-mode,
> because of the following statement at the end of semantic-c.el:
> (define-child-mode c++-mode c-mode
> "`c++-mode' uses the same parser as `c-mode'.")
> So the override stuff should work in c++-mode (and it actually works
> for me using Emacs 21.3/21.3.50 with cc-mode 5.31, and XEmacs 21.4.15
> with cc-mode 5.30.9).
> Could you try M-x describe-mode-local-bindings in your C++ header file
> to see the currently active overrides? Here is what I got on the
> semantic/tests/test.cpp file (Emacs 21.3.50):