Community
cancel
Showing results for 
Search instead for 
Did you mean: 
vetroxl
Beginner
883 Views

DEFINE_GUIDSTRUCT Gives "Error : type name is not allowed" In version 12

Jump to solution
Hi,
Using DEFINE_GUIDSTRUCT under Visual Studio 2010 and version 12 of the Intel C++ compiler gives the following error"Error : type name is not allowed"
0 Kudos
1 Solution
Judith_W_Intel
Employee
883 Views

I think I have come up with a reproducer for your problem.

This compiles fine with Microsoft, but broke in our 12.0 release:

void f() {
struct __declspec(uuid("00000000-0000-0000-0000-000000000000")) foo;
}

We will fix this as soon as possible. I have entered it into our bug tracking database as DPD200161827.

The problem is a disambiguation issue between declarations and expressions.

In the meantime, some possible workarounds are:

(1) Change

DEFINE_GUIDSTRUCT(__SOME_GUID__STRING__, SOME_TYPE_FOO_PROPSET);

to:

typedef DEFINE_GUIDSTRUCT(__SOME_GUID__STRING__, SOME_TYPE_FOO_PROPSET) SOME_TYPE_FOO_PROPSET;

(2) Or move this declaration:

DEFINE_GUIDSTRUCT(__SOME_GUID__STRING__, SOME_TYPE_FOO_PROPSET);

to someplace outside of the function (not sure if it's necessary for it to be different in each case label?)

Judy


View solution in original post

8 Replies
TimP
Black Belt
883 Views
You'd likely have to look at the pre-processed code and show an actual example here before anyone could comment further.
Om_S_Intel
Employee
883 Views
We may able to help better if you could share the test case.
vetroxl
Beginner
883 Views
Hi,
Sure, this is coming from a third party. So I can't really change the code. Also note that it compiled fine under version 11.060.
[cpp]switch (_some_type_)
{
case _some_type_foo:
{
  DEFINE_GUIDSTRUCT(__SOME_GUID__STRING__, SOME_TYPE_FOO_PROPSET);
#define SOME_TYPE_FOO_PROPSET DEFINE_GUIDNAMED(SOME_TYPE_FOO_PROPSET)
				_GUID_PROPSET = SOME_TYPE_FOO_PROPSET;
}
break;
}[/cpp]
Mark_S_Intel1
Employee
883 Views
Could you please compile the file in question with the "/P" option and send us the resulting .i file along with full compilation options used to compile the file?

Thanks,
--mark
Judith_W_Intel
Employee
884 Views

I think I have come up with a reproducer for your problem.

This compiles fine with Microsoft, but broke in our 12.0 release:

void f() {
struct __declspec(uuid("00000000-0000-0000-0000-000000000000")) foo;
}

We will fix this as soon as possible. I have entered it into our bug tracking database as DPD200161827.

The problem is a disambiguation issue between declarations and expressions.

In the meantime, some possible workarounds are:

(1) Change

DEFINE_GUIDSTRUCT(__SOME_GUID__STRING__, SOME_TYPE_FOO_PROPSET);

to:

typedef DEFINE_GUIDSTRUCT(__SOME_GUID__STRING__, SOME_TYPE_FOO_PROPSET) SOME_TYPE_FOO_PROPSET;

(2) Or move this declaration:

DEFINE_GUIDSTRUCT(__SOME_GUID__STRING__, SOME_TYPE_FOO_PROPSET);

to someplace outside of the function (not sure if it's necessary for it to be different in each case label?)

Judy


View solution in original post

vetroxl
Beginner
883 Views
Thanks, that works for now.
Judith_W_Intel
Employee
883 Views

we've fixed this in our 12.0 development compiler, so you should see a fix in the next 12.0 update.

thanks for bringing this to our attention.

Judy
Mark_S_Intel1
Employee
883 Views
This problem has been resolved in IntelC++ Composer XE update 1 (package ID w_ccompxe_2011.1.127.exe) available for download at registrationcenter.intel.com.

Reply