diff --git a/Test/baseResults/preprocessor.include.disabled.vert.err b/Test/baseResults/preprocessor.include.disabled.vert.err index da1704796..836a3d674 100644 --- a/Test/baseResults/preprocessor.include.disabled.vert.err +++ b/Test/baseResults/preprocessor.include.disabled.vert.err @@ -3,11 +3,11 @@ ERROR: 0:8000: '#include' : must be followed by a header name ERROR: 0:8001: '#include' : required extension not requested: GL_GOOGLE_include_directive ERROR: 0:8001: '#include' : must be followed by a header name ERROR: 0:8002: '#include' : required extension not requested: GL_GOOGLE_include_directive -ERROR: 0:8002: '#include' : unexpected include directive +ERROR: 0:8002: '#include' : unexpected include directive for header name: foo ERROR: 0:8003: '#include' : required extension not requested: GL_GOOGLE_include_directive -ERROR: 0:8003: '#include' : extra content after header name +ERROR: 0:8003: '#include' : extra content after header name: foo ERROR: 0:8004: '#include' : required extension not requested: GL_GOOGLE_include_directive -ERROR: 0:8004: '#include' : expected newline +ERROR: 0:8004: '#include' : expected newline after header name: no-eol ERROR: 10 compilation errors. No code generated. diff --git a/Test/baseResults/preprocessor.include.enabled.vert.err b/Test/baseResults/preprocessor.include.enabled.vert.err index b19b835cf..0b0cbae1f 100644 --- a/Test/baseResults/preprocessor.include.enabled.vert.err +++ b/Test/baseResults/preprocessor.include.enabled.vert.err @@ -1,13 +1,20 @@ ERROR: 0:8000: '#include' : must be followed by a header name ERROR: 0:8001: '#include' : must be followed by a header name -ERROR: 0:8002: '#include' : unexpected include directive -ERROR: 0:8003: '#include' : unexpected include directive -ERROR: 0:8004: '#include' : extra content after header name -ERROR: 0:8005: '#include' : extra content after header name -ERROR: 0:8007: '#include' : unexpected include directive -ERROR: 0:8009: '' : header name too long -ERROR: 0:8009: '#include' : unexpected include directive -ERROR: 0:8010: '#include' : expected newline -ERROR: 10 compilation errors. No code generated. +ERROR: 0:8002: '#include' : unexpected include directive for header name: foo.oeu +ERROR: 0:8003: '#include' : unexpected include directive for header name: foo.oeu/ao eu/ao.h +ERROR: 0:8004: '#include' : unexpected include directive for header name: foo +ERROR: 0:8006: '#include' : unexpected include directive for header name: foo.oe +ERROR: 0:8007: '#include' : unexpected include directive for header name: foo"bar" +ERROR: 0:8008: '#include' : unexpected include directive for header name: foo\bar +ERROR: 0:8009: '#include' : unexpected include directive for header name: foo.oe> +ERROR: 0:8010: '#include' : unexpected include directive for header name: foo +ERROR: 0:8011: '#include' : extra content after header name: foo2.h +ERROR: 0:8012: '#include' : extra content after header name: foo.h +ERROR: 0:8014: '#include' : unexpected include directive for header name: ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789 +ERROR: 0:8016: '' : header name too long +ERROR: 0:8016: '#include' : unexpected include directive for header name: ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789 +ERROR: 0:8017: '#include' : expected newline after header name: no-eol +ERROR: 17 compilation errors. No code generated. diff --git a/Test/preprocessor.include.enabled.vert b/Test/preprocessor.include.enabled.vert index 6d64b2301..985eae2ce 100644 --- a/Test/preprocessor.include.enabled.vert +++ b/Test/preprocessor.include.enabled.vert @@ -2,10 +2,17 @@ #line 8000 #include #include 123 -#include "foo" +#include "foo.oeu" +#include "foo.oeu/ao eu/ao.h" +#include "foo" +#include +#include +#include +#include "foo.oe>" #include -#include "foo" garbage -#include garbage +#include "foo2.h" garbage +#include garbage // max length #include // too long diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index dc1f9d02b..9d9a9e2e4 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -2,5 +2,5 @@ // For the version, it uses the latest git tag followed by the number of commits. // For the date, it uses the current date (when then script is run). -#define GLSLANG_REVISION "Overload400-PrecQual.1742" +#define GLSLANG_REVISION "Overload400-PrecQual.1744" #define GLSLANG_DATE "05-Jan-2017" diff --git a/glslang/MachineIndependent/preprocessor/Pp.cpp b/glslang/MachineIndependent/preprocessor/Pp.cpp index 02e452112..62348427d 100644 --- a/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -596,9 +596,9 @@ int TPpContext::CPPinclude(TPpToken* ppToken) token = scanToken(ppToken); if (token != '\n') { if (token == EndOfInput) - parseContext.ppError(ppToken->loc, "expected newline", "#include", ""); + parseContext.ppError(ppToken->loc, "expected newline after header name:", "#include", "%s", filename.c_str()); else - parseContext.ppError(ppToken->loc, "extra content after header name", "#include", ""); + parseContext.ppError(ppToken->loc, "extra content after header name:", "#include", "%s", filename.c_str()); } else { TShader::Includer::IncludeResult* res = includer.include(filename.c_str(), includeType, currentSourceFile.c_str(), includeStack.size() + 1); if (res && !res->file_name.empty()) { @@ -619,7 +619,7 @@ int TPpContext::CPPinclude(TPpToken* ppToken) std::string message = res ? std::string(res->file_data, res->file_length) : std::string("Could not process include directive"); - parseContext.ppError(directiveLoc, message.c_str(), "#include", ""); + parseContext.ppError(directiveLoc, message.c_str(), "#include", "for header name: %s", filename.c_str()); if (res) { includer.releaseInclude(res); }