Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Codan problems

If you think there is a bug in codan please file a bug report

On Sun, Aug 28, 2011 at 11:34 AM, Audrius Šaikūnas <tuxmarkv@xxxxxxxxx> wrote:
> Hello,
>
> this is my first post in this list, so sorry if I do anything wrong.
>
> I've been having a few problems with codan.
> The first problem appears only when using separate header & source
> files.
> The problematic method is C::hello2():
> If C::hello2() method is defined in header file, then codan resolves
> base method CBase::hello(Derived* derived) correctly.
> If C::hello2() method is defined in separate source file, which includes
> the header, then codan explains that "Function 'hello' could not be
> resolved"; A possible workaround to this problem would be to explicitly
> specify base class when invoking hello method (as in
> "CBase::hello(this);")
>
> However in my main project where I originally discovered this problem
> the workaround doesn't work - codan states that "Invalid arguments
> 'Candidates are: void hello(C *)' ". Same happens with methods which
> have no parameters. However I wasn't able to create a small testcase,
> which could reproduce the said error.
>
> // main.hh
> #pragma once
>
> template <template <typename> class _T1>
> struct Compose
> {
>  template <class _Type>
>  struct T0
>  {
>    typedef _T1<_Type> T1;
>  };
> };
>
> template <typename _Config>
> struct B
> {
>  typedef typename _Config::Derived Derived;
>
>  void hello(Derived* derived)
>  {
>  }
> };
>
> struct C;
>
> struct Config
> {
>  typedef C Derived;
> };
>
> typedef Compose<B>::T0<Config>::T1 CBase;
>
> struct C: CBase
> {
>  void hello2();
>  /*{
>    hello(this); // ok
>  }*/
> };
>
> // main.cc
> #include "main.hh"
>
> void C :: hello2()
> {
>  CBase::hello(this); // ok
>  hello(this);        // Function 'hello' could not be resolved
> }
>
> Another possible bug is related to c++0x variadic template
> specialization:
>
> template <typename... Elements> struct Foo;
>
> template <typename First, typename... Rest> struct Foo<First, Rest...>
> {
>  struct Inner { };
> };
>
> typedef Foo<int, int>::Inner Bar; // Type 'foo<int, int>::Inner could
> not be resolved'
>
> Removing 'typename First,' from template parameters and 'First,' from
> template specialization causes the error to disappear, but such code is
> no longer usable.
>
> All code snippets compile fine with gcc 4.5.4.
> This codan's behavior was observed with CDT shipped with Eclipse Indigo
> and with CDT from Eclipse Indigo SR1 RC1.
>
> Best regards,
>  Audrius
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>


Back to the top