diff options
author | Joey Gouly <joey.gouly@arm.com> | 2013-01-17 17:35:00 +0000 |
---|---|---|
committer | Joey Gouly <joey.gouly@arm.com> | 2013-01-17 17:35:00 +0000 |
commit | 1d58cdbf4e1737438f0cf94a3d6f827c1b03a39f (patch) | |
tree | a0903c92afa6131fef22c2e2c9ec638a9bc099f2 /clang/lib/Lex | |
parent | 80a82761bde1fee351c6a7381f439ba8b6213198 (diff) | |
download | bcm5719-llvm-1d58cdbf4e1737438f0cf94a3d6f827c1b03a39f.tar.gz bcm5719-llvm-1d58cdbf4e1737438f0cf94a3d6f827c1b03a39f.zip |
Add some semantic checks for OpenCL. Variadic macros, VLAs and bitfields are not supported.
llvm-svn: 172732
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 7e46a9cc28e..156ebd21f9d 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -1649,6 +1649,12 @@ bool Preprocessor::ReadMacroDefinitionArgList(MacroInfo *MI, Token &Tok) { diag::warn_cxx98_compat_variadic_macro : diag::ext_variadic_macro); + // OpenCL v1.2 s6.9.e: variadic macros are not supported. + if (LangOpts.OpenCL) { + Diag(Tok, diag::err_pp_opencl_variadic_macros); + return true; + } + // Lex the token after the identifier. LexUnexpandedToken(Tok); if (Tok.isNot(tok::r_paren)) { |