diff options
Diffstat (limited to 'gcc/d/dmd/dmodule.d')
-rw-r--r-- | gcc/d/dmd/dmodule.d | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/d/dmd/dmodule.d b/gcc/d/dmd/dmodule.d index 84e29fe1023..6568442c17a 100644 --- a/gcc/d/dmd/dmodule.d +++ b/gcc/d/dmd/dmodule.d @@ -615,6 +615,14 @@ extern (C++) final class Module : Package const dmdConfFile = global.inifilename.length ? FileName.canonicalName(global.inifilename) : "not found"; errorSupplemental(loc, "config file: %.*s", cast(int)dmdConfFile.length, dmdConfFile.ptr); } + else if (FileName.ext(this.arg) || !loc.isValid()) + { + // Modules whose original argument name has an extension, or do not + // have a valid location come from the command-line. + // Error that their file cannot be found and return early. + .error(loc, "cannot find input file `%s`", srcfile.toChars()); + return false; + } else { // if module is not named 'package' but we're trying to read 'package.d', we're looking for a package module |