]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
d: Turn on deprecation warnings by default.
authorIain Buclaw <ibuclaw@gdcproject.org>
Tue, 23 Jun 2020 08:40:37 +0000 (10:40 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Thu, 25 Jun 2020 15:02:45 +0000 (17:02 +0200)
This is the default in the upstream reference compiler, and can reduce
some confusion when comparing warning/error messages of gdc and dmd side
by side.

Merges libphobos with upstream druntime d05ebaad and phobos 021ae0df7.

Reviewed-on: https://github.com/dlang/druntime/pull/3127
     https://github.com/dlang/phobos/pull/7521

gcc/d/ChangeLog:

* d-lang.cc (d_init_options): Turn on deprecation warnings by default.

libphobos/ChangeLog:

* libdruntime/MERGE: Merge upstream druntime d05ebaad.
* src/MERGE: Merge upstream phobos 021ae0df7.
* testsuite/libphobos.typeinfo/struct-align.d: Remove empty statement.

gcc/testsuite/ChangeLog:

* gdc.dg/asm1.d: Don't use deprecated asm syntax.
* gdc.dg/compilable.d: Add public to selective import.
* gdc.dg/lto/ltotests_0.d: Explicitly catch Throwable.
* gdc.dg/runnable.d: Remove empty statement.

gcc/d/d-lang.cc
gcc/testsuite/gdc.dg/asm1.d
gcc/testsuite/gdc.dg/compilable.d
gcc/testsuite/gdc.dg/lto/ltotests_0.d
gcc/testsuite/gdc.dg/runnable.d
libphobos/libdruntime/MERGE
libphobos/libdruntime/rt/util/utf.d
libphobos/src/MERGE
libphobos/src/std/range/package.d
libphobos/testsuite/libphobos.typeinfo/struct-align.d

index 82e24de8cd1edf51cbf8b3797ee4c84dc7b76053..24a1125ef8dd690f38b9c14ec3f7d79a9f1f1838 100644 (file)
@@ -306,7 +306,7 @@ d_init_options (unsigned int, cl_decoded_option *decoded_options)
   global.params.cplusplus = CppStdRevisionCpp14;
 
   /* Warnings and deprecations are disabled by default.  */
-  global.params.useDeprecated = DIAGNOSTICoff;
+  global.params.useDeprecated = DIAGNOSTICinform;
   global.params.warnings = DIAGNOSTICoff;
 
   global.params.imppath = new Strings ();
index 3fcfd6a58c11c8a06445682f76ba5d1eec3a9e4b..dce36769370411f5a0034b8b0bb6e176b7681927 100644 (file)
@@ -13,8 +13,8 @@ void parse2()
 {
     asm 
     {
-        "" : : "g" 1 ? 2 : 3;
-        "" : : "g" 1 ? 2 : : 3;
+        "" : : "g" (1 ? 2 : 3);
+        "" : : "g" (1 ? 2 : :) 3;
         // { dg-error "expression expected, not ':'" "" { target *-*-* } .-1 }
         // { dg-error "expected constant string constraint for operand" "" { target *-*-* } .-2 }
     }
@@ -58,7 +58,7 @@ void semantic1()
 void semantic2a(X...)(X expr)
 {
     alias X[0] var1;
-    asm { "%0" : "=m" var1; }   // { dg-error "double 'double' is a type, not an lvalue" }
+    asm { "%0" : "=m" (var1); } // { dg-error "double 'double' is a type, not an lvalue" }
 }
 
 void semantic2()
@@ -86,6 +86,6 @@ void semantic4()
 {
     asm
     {
-        "%0" : : "m" S4.foo;    // { dg-error "template instance opDispatch!\"foo\" has no value" }
+        "%0" : : "m" (S4.foo);  // { dg-error "template instance opDispatch!\"foo\" has no value" }
     }
 }
index 92a18756a0e33b7d6394a5fb1bf8d7a73f15f788..3f92f9b2957403c989fde48b18b43be6ef8a5e75 100644 (file)
@@ -250,7 +250,7 @@ class C204 : I204
 // https://bugzilla.gdcproject.org/show_bug.cgi?id=241
 
 import imports.gdc241a;
-import imports.gdc241b : S241, C241, E241, N241;
+public import imports.gdc241b : S241, C241, E241, N241;
 
 /******************************************/
 // https://bugzilla.gdcproject.org/show_bug.cgi?id=242
index bb18beaa9c86081a3f775a80f9fccfb992bd628f..91737609f100bf34f6c427854d4a1d397e81b304 100644 (file)
@@ -46,7 +46,7 @@ struct S61b
     {
         try
             other.a();
-        catch
+        catch (Throwable)
             other.b();
     }
 }
index 7307e09a645d2a1e93d21ab446dc6430324bc9dd..d974bda8c58fb5dfc4fb797a8d526955cf17a077 100644 (file)
@@ -243,7 +243,7 @@ void test36b()(char val)
 auto test36c_1()
 {
     int a;
-    void c() {};
+    void c() {}
     class Result
     {
         int b;
index 5e3bf3b795a99b92c38e9576e402fd83c2676d71..bcde10514ec685b4d656a7fcab7591752955f8dc 100644 (file)
@@ -1,4 +1,4 @@
-5cc061a8733731d5b40334c0eb7a927b6d6241ce
+d05ebaad15fbffce6d707c138c84d7b60fcf5ffd
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/druntime repository.
index 07758409ec757ec718bb067016a9fdce984d3607..55869b37c8cb2faf62bae4f808469a1d9674f227 100644 (file)
@@ -651,9 +651,9 @@ string toUTF8(in wchar[] s)
         else
         {
             r.length = i;
-            foreach (dchar c; s[i .. slen])
+            foreach (dchar ch; s[i .. slen])
             {
-                encode(r, c);
+                encode(r, ch);
             }
             break;
         }
index 5900ca7c6a4394ab33832d5b9b5e3476c1463f9c..1562f747b74100f0ae3e02592288f55a0df68189 100644 (file)
@@ -1,4 +1,4 @@
-64ed4684fa2a0f2401f5b6df34f6dcb4c3973945
+021ae0df76727a32809a29887095ab7093489ea3
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/phobos repository.
index fe581f3853bb567c711ec84c3dea363adef7decd..13601cb9da9efeacf773be7b055223df8ac9c8ed 100644 (file)
@@ -4874,7 +4874,7 @@ if (allSatisfy!(isInputRange, Ranges))
     // Just make sure 1-range case instantiates.  This hangs the compiler
     // when no explicit stopping policy is specified due to Bug 4652.
     auto stuff = lockstep([1,2,3,4,5], StoppingPolicy.shortest);
-    foreach (int i, a; stuff)
+    foreach (i, a; stuff)
     {
         assert(stuff[i] == a);
     }
index 72866517481ddfd9e66801885422b82b2c95ec00..54eaaa6ff5aed94132bdf83617ece4257e19e1c4 100644 (file)
@@ -2,7 +2,7 @@ module structalign;
 
 void main ()
 {
-    struct K { int *a; };
+    struct K { int *a; }
     K k;
     auto ti = typeid (k);