Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7944 Discussions

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

vetroxl
Beginner
1,609 Views
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
1,609 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
TimP
Honored Contributor III
1,609 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
Om_S_Intel
Employee
1,609 Views
We may able to help better if you could share the test case.
0 Kudos
vetroxl
Beginner
1,609 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
Mark_S_Intel1
Employee
1,609 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
Judith_W_Intel
Employee
1,610 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


0 Kudos
vetroxl
Beginner
1,609 Views
Thanks, that works for now.
0 Kudos
Judith_W_Intel
Employee
1,609 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
Mark_S_Intel1
Employee
1,609 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
Reply