This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Diagnose some reserved types
Needs ReviewPublic

Authored by svenvh on Jun 8 2017, 5:46 AM.

Details

Reviewers
yaxunl
Summary

Catch uses of the 'long long', 'unsigned long long', and 'long double'
reserved types.

Remove use of 'long long' in test/Misc/languageOptsOpenCL.cl; it
shouldn't have been added there in the first place as the OpenCL
specification explicitly forbids it in s6.1.4.

Initial patch by Simon Perretta.

Diff Detail

Event Timeline

svenvh created this revision.Jun 8 2017, 5:46 AM
yaxunl edited edge metadata.Jul 5 2017, 12:23 PM

Sorry for the delay.

The spec says:

The data type names described in the table below are reserved and cannot be used by applications as user-defined type names.

However, it does not forbid using the reserved types as builtin types if the compiler supports it.

I would suggest to emit warning instead of error.

lib/Sema/SemaType.cpp
1366

Please put else on the same line as } to be consistent with the rest of the code. same as below.