[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4269

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|D1  D2 |D2

--


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2013-08-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #29 from github-bugzi...@puremagic.com 2013-08-28 14:34:46 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/821cd3c604e08dcad7dccca5428389252555ad9c
Improve bug4269 test cases

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2013-01-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #28 from github-bugzi...@puremagic.com 2013-01-16 01:52:33 PST ---
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/f0a12c85632e5bba8bf0752aa66f2ab97317e5c9
Fix bug 4269 case 13:invalid template accepted if evaluated while errors are
gagged

Need to ungag template declarations if they are forward referenced.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2013-01-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-12-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

   Keywords||pull


--- Comment #26 from Don clugd...@yahoo.com.au 2012-12-13 01:05:42 PST ---
All test cases now correctly give an error, except for case 13, which is fixed
in

https://github.com/D-Programming-Language/dmd/pull/1370

There are also diagnostic problems with 3 other test cases, I have created bug
9146 for those. It is much less serious than this bug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-12-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #27 from github-bugzi...@puremagic.com 2012-12-13 06:46:13 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/2a1d419a4d87c9a29d3d07f78fc8319ed8a5fc37
Fix bug 4269 case 13:invalid template accepted if evaluated while errors are
gagged

Need to ungag template declarations if they are forward referenced.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 CC||verylonglogin@gmail.com


--- Comment #25 from Don clugd...@yahoo.com.au 2012-05-03 02:53:14 PDT ---
*** Issue 6296 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #23 from github-bugzi...@puremagic.com 2012-02-22 02:22:28 PST ---
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/baf9d8c832c50e15912d16c7dd9f85fcf440522f
Issue 4269 - Regression(2.031): invalid type accepted if evaluated while errors
are gagged

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #24 from Walter Bright bugzi...@digitalmars.com 2012-02-22 
02:25:38 PST ---
https://github.com/D-Programming-Language/dmd/pull/729

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #22 from github-bugzi...@puremagic.com 2012-02-11 10:26:23 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/ae73e0e9e0cca35cc47ebcb08700f674a0c77ad0
Merge pull request #706 from yebblies/issue4269x

Restore tests that were accidentally removed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

   Platform|Other   |All
   Severity|normal  |regression


--- Comment #18 from yebblies yebbl...@gmail.com 2012-02-10 22:17:54 EST ---
Having a closer look at Walter's patch, this only fixes the issue for class,
struct and interface declarations.  From the list in comment 5, function,
variable, template and alias this declarations still need to be fixed to get
this off the regression list.

Don, I thought you meant you'd tested with your new patch and it still crashed
- is this the case or is this only with Walter's fix?  The underlying reason is
the same, but when this bug is fixed the crash will disappear as it will never
get to codegen.

Walter, please see the list in comment 5, everything here needs to fail before
this stops being an ice/regression.  Please also note that
https://github.com/D-Programming-Language/dmd/commit/75ccf8c3ae057aad7128d710fe735f7772be0471
overwrote three test cases from this bug that dealt with alias and template
declarations.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

   Severity|regression  |normal


--- Comment #19 from yebblies yebbl...@gmail.com 2012-02-10 23:05:52 EST ---
To be more specific - any declaration semantic routine that might result in
errors needs to give an error the second time semantic is run too - the reason
it happens with the X3 test case is because errors in parameter types are not
propagated to the function type, but there are plenty of other errors in
FuncDeclaration::semantic that will be silently ignored as the type isn't set
to Type::terror.  I haven't looked at the other declaration types yet but there
are probably cases there too.

Some FuncDeclaration cases:

//static if (is(typeof(X17.init))) {}
//scope void X17() {}

//static if (is(typeof(X18.init))) {}
//abstract void X18() {}

//static if (is(typeof(X19.init))) {}
//override void X19() {}

//static if (is(typeof(X20.init))) {}
//const void X20() {}

//static if (is(typeof(X21.init))) {}
//immutable void X21() {}

//static if (is(typeof(main.init))) {}
//string main();

//static if (is(typeof(main.init))) {}
//auto main() { return ; }

//static if (is(typeof(main.init))) {}
//void main(int) { }

Some of these are just accepts-invalid with meaningless attributes, but the
'main' ones will generate wrong code.

Errors in the declaration type are not all that needs to be monitored - either
the error count needs to be examined or every possible error needs to set the
type to Type::terror.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

   Keywords||wrong-code


--- Comment #20 from yebblies yebbl...@gmail.com 2012-02-10 23:11:42 EST ---
The approach of using Declaration::type to signal semantic failed also relies
on Type::semantic returning Type::terror on every error - this is not followed
everywhere.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #21 from Don clugd...@yahoo.com.au 2012-02-10 07:12:18 PST ---
My upcoming patch fixes all of your cases in comment 5 except #13. My comment
in comment 16 is about Walter's commit, not my patch.

But it's not quite ready, it fails some cases in the test suite related to
__traits(compiles) with deprecated and purity.
I *think* I just have to do a bit more work on enabling and disabling gagging
at the right time.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #16 from Don clugd...@yahoo.com.au 2012-02-09 07:55:58 PST ---
Even with the new patch, this example from comment 5 :

static if(is(typeof(X3.init))) {}
void X3(T3) { }

is an ICE(glue.c) for 2.047 on. It generated an error on 2.045 and earlier. (On
2.046 it silently generated bad code). Perhaps it should be treated as a
different bug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #17 from yebblies yebbl...@gmail.com 2012-02-10 03:08:33 EST ---
(In reply to comment #16)
 Even with the new patch, this example from comment 5 :
 
 static if(is(typeof(X3.init))) {}
 void X3(T3) { }
 
 is an ICE(glue.c) for 2.047 on. It generated an error on 2.045 and earlier. 
 (On
 2.046 it silently generated bad code). Perhaps it should be treated as a
 different bug.

Yep, different bug.  The crash is due to an error in a parameter type not
resulting in TypeFunction::semantic returning terror.  (Or at least, that and
the fact it reaches code generation due to this bug.)  I swear I fixed this in
a pull request last year, but it must've been part of something that never got
accepted.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

   Severity|regression  |normal


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #15 from Don clugd...@yahoo.com.au 2012-02-07 01:05:27 PST ---
So far my patch fixes the original bug report, and about 60% of Daniel's extra
test cases.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #11 from Walter Bright bugzi...@digitalmars.com 2012-02-06 
20:59:24 PST ---
The whole idea of error gagging is probably bogus because of this.

I don't know what to do about it.

One possibility might be to attach gagged error messages to the symbol having
semantic() run on, and then replaying those messages if the symbol is used
outside of the gag.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #12 from yebblies yebbl...@gmail.com 2012-02-07 17:28:39 EST ---
Don seems to have a handle on this.  He explained his solution to me in
comments on https://github.com/D-Programming-Language/dmd/pull/652 and it seems
quite solid.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #13 from github-bugzi...@puremagic.com 2012-02-06 22:42:30 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/75ccf8c3ae057aad7128d710fe735f7772be0471
Issue 4269 - Regression(2.031): invalid type accepted if evaluated while errors
are gagged

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 OS/Version|Windows |All


--- Comment #14 from Walter Bright bugzi...@digitalmars.com 2012-02-06 
22:44:36 PST ---
My patch doesn't thoroughly fix this, it just gets it off the regression list.
It outputs a generic error message.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2011-09-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |


--- Comment #10 from yebblies yebbl...@gmail.com 2011-09-21 12:13:36 EST ---
That patch only fixes this issue for alias and typedef, not other declarations.

D2 commit:
https://github.com/D-Programming-Language/dmd/commit/a12dfec8b6427ae08730ff52c6b54e83f16906e3

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2011-09-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269


klickverbot c...@klickverbot.at changed:

   What|Removed |Added

 CC||c...@klickverbot.at


--- Comment #8 from klickverbot c...@klickverbot.at 2011-09-04 22:51:20 PDT 
---
Related, but not the same: bug 6602.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2011-08-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #6 from Don clugd...@yahoo.com.au 2011-08-30 01:42:25 PDT ---
I think there are a couple of different issues here. Some involve forward
referenced declarations, as you've said.
But some of these occur because they have semantic run while errors are
_incorrectly_ gagged. In particular, when semantic3 is run on a function,
errors shouldn't be gagged unless the function is part of a template which was
speculatively instantiated. I'm halfway through a patch for this.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2011-08-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #7 from yebblies yebbl...@gmail.com 2011-08-31 00:58:01 EST ---
(In reply to comment #6)
 I think there are a couple of different issues here. Some involve forward
 referenced declarations, as you've said.
 But some of these occur because they have semantic run while errors are
 _incorrectly_ gagged. In particular, when semantic3 is run on a function,
 errors shouldn't be gagged unless the function is part of a template which was
 speculatively instantiated. I'm halfway through a patch for this.

Does your gagging solution fix the problem for all semantic passes, or just
semantic3?  I couldn't think of a way to do it without rewinding semantic on
error, that gets error messages appearing in the right places.  Since you've
got it under control, I'll work on something else.

Should I close the pull request, does your patch cover that?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2011-02-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 CC||sandf...@jhu.edu


--- Comment #4 from Don clugd...@yahoo.com.au 2011-02-11 05:23:49 PST ---
*** Issue 5079 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2010-08-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269



--- Comment #3 from Don clugd...@yahoo.com.au 2010-08-25 12:44:15 PDT ---
This test case it's a problem with is(), not static if. This behaviour was
introduced in 2.047.

enum bool WWW = is(typeof(A.x));

class A {
B blah;
void foo(B b){} 
}


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2010-06-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 CC||clugd...@yahoo.com.au
Version|unspecified |D2
Summary|invalid type accepted if|Regression(2.031): invalid
   |evaluated while errors are  |type accepted if evaluated
   |gagged  |while errors are gagged
   Severity|normal  |regression


--- Comment #1 from Don clugd...@yahoo.com.au 2010-06-15 07:25:53 PDT ---
Generated an error message in 2.030 and earlier.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2010-06-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code
Version|D2  |D1  D2


--- Comment #2 from Don clugd...@yahoo.com.au 2010-06-15 13:41:05 PDT ---
Here's a test case which incorrectly compiles on D1.055 and later, but
generated an error on DMD1.053 and earlier.

static if(!is(typeof(A[0]))) pragma(msg, A.sizeof doesn't compile!);

struct A {
B foo(){} 
}

And this variation is ICE(glue.c) on 2.047, but generates wrong code on
2.031-2.046.

static if(!is(typeof(A[0]))) pragma(msg, A.sizeof doesn't compile!);
struct A {
void foo(B b){} 
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---