Compiler Error C2788

'identifier' : more than one GUID associated with this object

The __uuidof operator finds more than one GUID associated with the same object.

The example below causes this error:

struct __declspec(uuid("00000001-0000-0000-0000-000000000000")) A { };
struct __declspec(uuid("{00000002-0000-0000-0000-000000000000}")) B { };

template <class T, class U> class Foo { };

typedef Foo<A,B> MyBadFoo;
typedef Foo<A,A> MyGoodFoo;

void bar(void)
{
    __uuidof(MyBadFoo);      // error C2788
    __uuidof(MyGoodFoo);   // OK
}