mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
make pragma great again
This commit is contained in:
parent
2625a1607c
commit
2d42fdbcf8
4 changed files with 7 additions and 5 deletions
3
changelog/dmd.pragma.dd
Normal file
3
changelog/dmd.pragma.dd
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Unrecognized pragmas are no longer an error, but instead simply ignored
|
||||||
|
|
||||||
|
Previously, unrecognized pragmas would issue a hard error unless you used the `-ignore` dmd switch. Now, they are always ignored and the `-ignore` dmd switch is ignored.
|
|
@ -3086,7 +3086,7 @@ struct Param final
|
||||||
cov(),
|
cov(),
|
||||||
covPercent(),
|
covPercent(),
|
||||||
ctfe_cov(false),
|
ctfe_cov(false),
|
||||||
ignoreUnsupportedPragmas(),
|
ignoreUnsupportedPragmas(true),
|
||||||
useModuleInfo(true),
|
useModuleInfo(true),
|
||||||
useTypeInfo(true),
|
useTypeInfo(true),
|
||||||
useExceptions(true),
|
useExceptions(true),
|
||||||
|
@ -3146,7 +3146,7 @@ struct Param final
|
||||||
mapfile()
|
mapfile()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
Param(bool obj, bool multiobj = false, bool trace = false, bool tracegc = false, bool vcg_ast = false, DiagnosticReporting useDeprecated = (DiagnosticReporting)1u, bool useUnitTests = false, bool useInline = false, bool release = false, bool preservePaths = false, DiagnosticReporting warnings = (DiagnosticReporting)2u, bool cov = false, uint8_t covPercent = 0u, bool ctfe_cov = false, bool ignoreUnsupportedPragmas = false, bool useModuleInfo = true, bool useTypeInfo = true, bool useExceptions = true, bool useGC = true, bool betterC = false, bool addMain = false, bool allInst = false, bool bitfields = false, CppStdRevision cplusplus = (CppStdRevision)201103u, Help help = Help(), Verbose v = Verbose(), FeatureState useDIP25 = (FeatureState)2u, FeatureState useDIP1000 = (FeatureState)0u, bool ehnogc = false, bool useDIP1021 = false, FeatureState fieldwise = (FeatureState)0u, bool fixAliasThis = false, FeatureState rvalueRefParam = (FeatureState)0u, FeatureState noSharedAccess = (FeatureState)0u, bool previewIn = false, bool inclusiveInContracts = false, bool shortenedMethods = true, bool fixImmutableConv = false, bool fix16997 = true, FeatureState dtorFields = (FeatureState)0u, FeatureState systemVariables = (FeatureState)0u, CHECKENABLE useInvariants = (CHECKENABLE)0u, CHECKENABLE useIn = (CHECKENABLE)0u, CHECKENABLE useOut = (CHECKENABLE)0u, CHECKENABLE useArrayBounds = (CHECKENABLE)0u, CHECKENABLE useAssert = (CHECKENABLE)0u, CHECKENABLE useSwitchError = (CHECKENABLE)0u, CHECKENABLE boundscheck = (CHECKENABLE)0u, CHECKACTION checkAction = (CHECKACTION)0u, _d_dynamicArray< const char > argv0 = {}, Array<const char* > modFileAliasStrings = Array<const char* >(), Array<const char* >* imppath = nullptr, Array<const char* >* fileImppath = nullptr, _d_dynamicArray< const char > objdir = {}, _d_dynamicArray< const char > objname = {}, _d_dynamicArray< const char > libname = {}, Output ddoc = Output(), Output dihdr = Output(), Output cxxhdr = Output(), Output json = Output(), JsonFieldFlags jsonFieldFlags = (JsonFieldFlags)0u, Output makeDeps = Output(), Output mixinOut = Output(), Output moduleDeps = Output(), uint32_t debuglevel = 0u, uint32_t versionlevel = 0u, bool run = false, Array<const char* > runargs = Array<const char* >(), Array<const char* > cppswitches = Array<const char* >(), const char* cpp = nullptr, Array<const char* > objfiles = Array<const char* >(), Array<const char* > linkswitches = Array<const char* >(), Array<bool > linkswitchIsForCC = Array<bool >(), Array<const char* > libfiles = Array<const char* >(), Array<const char* > dllfiles = Array<const char* >(), _d_dynamicArray< const char > deffile = {}, _d_dynamicArray< const char > resfile = {}, _d_dynamicArray< const char > exefile = {}, _d_dynamicArray< const char > mapfile = {}) :
|
Param(bool obj, bool multiobj = false, bool trace = false, bool tracegc = false, bool vcg_ast = false, DiagnosticReporting useDeprecated = (DiagnosticReporting)1u, bool useUnitTests = false, bool useInline = false, bool release = false, bool preservePaths = false, DiagnosticReporting warnings = (DiagnosticReporting)2u, bool cov = false, uint8_t covPercent = 0u, bool ctfe_cov = false, bool ignoreUnsupportedPragmas = true, bool useModuleInfo = true, bool useTypeInfo = true, bool useExceptions = true, bool useGC = true, bool betterC = false, bool addMain = false, bool allInst = false, bool bitfields = false, CppStdRevision cplusplus = (CppStdRevision)201103u, Help help = Help(), Verbose v = Verbose(), FeatureState useDIP25 = (FeatureState)2u, FeatureState useDIP1000 = (FeatureState)0u, bool ehnogc = false, bool useDIP1021 = false, FeatureState fieldwise = (FeatureState)0u, bool fixAliasThis = false, FeatureState rvalueRefParam = (FeatureState)0u, FeatureState noSharedAccess = (FeatureState)0u, bool previewIn = false, bool inclusiveInContracts = false, bool shortenedMethods = true, bool fixImmutableConv = false, bool fix16997 = true, FeatureState dtorFields = (FeatureState)0u, FeatureState systemVariables = (FeatureState)0u, CHECKENABLE useInvariants = (CHECKENABLE)0u, CHECKENABLE useIn = (CHECKENABLE)0u, CHECKENABLE useOut = (CHECKENABLE)0u, CHECKENABLE useArrayBounds = (CHECKENABLE)0u, CHECKENABLE useAssert = (CHECKENABLE)0u, CHECKENABLE useSwitchError = (CHECKENABLE)0u, CHECKENABLE boundscheck = (CHECKENABLE)0u, CHECKACTION checkAction = (CHECKACTION)0u, _d_dynamicArray< const char > argv0 = {}, Array<const char* > modFileAliasStrings = Array<const char* >(), Array<const char* >* imppath = nullptr, Array<const char* >* fileImppath = nullptr, _d_dynamicArray< const char > objdir = {}, _d_dynamicArray< const char > objname = {}, _d_dynamicArray< const char > libname = {}, Output ddoc = Output(), Output dihdr = Output(), Output cxxhdr = Output(), Output json = Output(), JsonFieldFlags jsonFieldFlags = (JsonFieldFlags)0u, Output makeDeps = Output(), Output mixinOut = Output(), Output moduleDeps = Output(), uint32_t debuglevel = 0u, uint32_t versionlevel = 0u, bool run = false, Array<const char* > runargs = Array<const char* >(), Array<const char* > cppswitches = Array<const char* >(), const char* cpp = nullptr, Array<const char* > objfiles = Array<const char* >(), Array<const char* > linkswitches = Array<const char* >(), Array<bool > linkswitchIsForCC = Array<bool >(), Array<const char* > libfiles = Array<const char* >(), Array<const char* > dllfiles = Array<const char* >(), _d_dynamicArray< const char > deffile = {}, _d_dynamicArray< const char > resfile = {}, _d_dynamicArray< const char > exefile = {}, _d_dynamicArray< const char > mapfile = {}) :
|
||||||
obj(obj),
|
obj(obj),
|
||||||
multiobj(multiobj),
|
multiobj(multiobj),
|
||||||
trace(trace),
|
trace(trace),
|
||||||
|
|
|
@ -167,7 +167,7 @@ extern (C++) struct Param
|
||||||
bool cov; // generate code coverage data
|
bool cov; // generate code coverage data
|
||||||
ubyte covPercent; // 0..100 code coverage percentage required
|
ubyte covPercent; // 0..100 code coverage percentage required
|
||||||
bool ctfe_cov = false; // generate coverage data for ctfe
|
bool ctfe_cov = false; // generate coverage data for ctfe
|
||||||
bool ignoreUnsupportedPragmas; // rather than error on them
|
bool ignoreUnsupportedPragmas = true; // rather than error on them
|
||||||
bool useModuleInfo = true; // generate runtime module information
|
bool useModuleInfo = true; // generate runtime module information
|
||||||
bool useTypeInfo = true; // generate runtime type information
|
bool useTypeInfo = true; // generate runtime type information
|
||||||
bool useExceptions = true; // support exception handling
|
bool useExceptions = true; // support exception handling
|
||||||
|
|
|
@ -5,7 +5,6 @@ TEST_OUTPUT:
|
||||||
---
|
---
|
||||||
fail_compilation/pragmas.d(103): Error: one boolean expression expected for `pragma(inline)`, not 2
|
fail_compilation/pragmas.d(103): Error: one boolean expression expected for `pragma(inline)`, not 2
|
||||||
fail_compilation/pragmas.d(108): Error: one boolean expression expected for `pragma(inline)`, not 2
|
fail_compilation/pragmas.d(108): Error: one boolean expression expected for `pragma(inline)`, not 2
|
||||||
fail_compilation/pragmas.d(118): Error: unrecognized `pragma(unrecognized)`
|
|
||||||
---
|
---
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -28,5 +27,5 @@ void test3()
|
||||||
|
|
||||||
void test4()
|
void test4()
|
||||||
{
|
{
|
||||||
pragma(unrecognized, "string");
|
pragma(unrecognized, "string"); // permitted, just ignored
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue