Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
239 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

Accepted Solutions
Highlighted
Employee
239 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

0 Kudos
8 Replies
Highlighted
Black Belt
239 Views
You'd likely have to look at the pre-processed code and show an actual example here before anyone could comment further.
0 Kudos
Highlighted
Employee
239 Views
We may able to help better if you could share the test case.
0 Kudos
Highlighted
Beginner
239 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]
0 Kudos
Highlighted
Employee
239 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
0 Kudos
Highlighted
Employee
240 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

0 Kudos
Highlighted
Beginner
239 Views
Thanks, that works for now.
0 Kudos
Highlighted
Employee
239 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
0 Kudos
Highlighted
Employee
239 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.

0 Kudos