Resend: Prefast problem with partial specialization of a template class - Software-Testing

This is a discussion on Resend: Prefast problem with partial specialization of a template class - Software-Testing ; Any light on this problem would be much appreciated! ------------------- I have a fairly large project that uses C++ partial templates. This works fine to build with CE5. However, it seems like prefast doesn't handle this correctly. The snippet below ...

+ Reply to Thread
Results 1 to 2 of 2

Resend: Prefast problem with partial specialization of a template class

  1. Default Resend: Prefast problem with partial specialization of a template class



    Any light on this problem would be much appreciated!


    -------------------

    I have a fairly large project that uses C++ partial templates. This
    works fine to build with CE5. However, it seems like prefast doesn't
    handle this correctly.

    The snippet below reproduces the problem I see in my larger project.
    Building this code below with prefast gives:

    * error C2065: 'T' : undeclared identifier
    * error C2687: cannot define a nested UDT of a template class out of line
    * fatal error C1903: unable to recover from previous error(s); stopping
    compilation

    (It works fine building the code with "build -c", but "prefast build -c"
    gives this error)

    Is it possible to report a bug for this? Maybe there's a fix available
    already?

    Regards
    C.

    -------------------------------

    template<typename T, bool b>
    class Foo
    {
    protected:
    Foo()
    {
    }
    };

    template<typename T>
    class Foo<T, false>
    {
    public:
    Foo()
    {
    }
    };



  2. Default Re: Resend: Prefast problem with partial specialization of a template class

    Sorry I missed this the first time. The version of Prefast shipped with
    Platform Builder has some inconsistencies with the latest compilers.
    Unfortunately, there is no workaround, but this should be fixed in a future
    version.

    Sorry again for the inconvenience.

    "Charlie Peterson" <charlie@nospam.com> wrote in message
    news:ubOzsOcJFHA.616@TK2MSFTNGP10.phx.gbl...
    >
    >
    > Any light on this problem would be much appreciated!
    >
    >
    > -------------------
    >
    > I have a fairly large project that uses C++ partial templates. This
    > works fine to build with CE5. However, it seems like prefast doesn't
    > handle this correctly.
    >
    > The snippet below reproduces the problem I see in my larger project.
    > Building this code below with prefast gives:
    >
    > * error C2065: 'T' : undeclared identifier
    > * error C2687: cannot define a nested UDT of a template class out of line
    > * fatal error C1903: unable to recover from previous error(s); stopping
    > compilation
    >
    > (It works fine building the code with "build -c", but "prefast build -c"
    > gives this error)
    >
    > Is it possible to report a bug for this? Maybe there's a fix available
    > already?
    >
    > Regards
    > C.
    >
    > -------------------------------
    >
    > template<typename T, bool b>
    > class Foo
    > {
    > protected:
    > Foo()
    > {
    > }
    > };
    >
    > template<typename T>
    > class Foo<T, false>
    > {
    > public:
    > Foo()
    > {
    > }
    > };
    >
    >




+ Reply to Thread

Similar Threads

  1. Template Partial Specialization
    By Application Development in forum C
    Replies: 4
    Last Post: 11-19-2007, 05:01 PM
  2. partial template specialization
    By Application Development in forum c++
    Replies: 3
    Last Post: 10-11-2007, 01:01 AM
  3. Partial template specialization
    By Application Development in forum c++
    Replies: 1
    Last Post: 06-28-2007, 09:58 AM
  4. Replies: 0
    Last Post: 03-05-2007, 09:55 AM
  5. Prefast problem with partial specialization of a template class
    By Application Development in forum Software-Testing
    Replies: 0
    Last Post: 03-05-2005, 10:48 AM