D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 12490 - No "Error: , has no effect" Error for comma expression LHS
Summary: No "Error: , has no effect" Error for comma expression LHS
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid, diagnostic, pull
Depends on:
Blocks:
 
Reported: 2014-03-29 14:34 UTC by monarchdodra
Modified: 2020-07-14 10:55 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description monarchdodra 2014-03-29 14:34:46 UTC
//----
    5, someFun();
//----
    1 + 2, someFun();
//----

I think these should trigger an error. The LHS clearly does nothing, and the result is not stored anywhere.
Comment 1 basile-z 2020-07-04 17:56:04 UTC
---
void someFun(){}

void main()
{
    5, someFun();
    1 + 2, someFun();
}
---
Comment 2 Dlang Bot 2020-07-06 03:32:30 UTC
@NilsLankila created dlang/dmd pull request #11377 "fix issue 12490 - No "Error: , has no effect" Error for comma expression LHS" fixing this issue:

- fix issue 12490 - No "Error: , has no effect" Error for comma expression LHS
  
  Following a comment in sideeffect.d on how to check the LHS.

https://github.com/dlang/dmd/pull/11377
Comment 3 Dlang Bot 2020-07-14 10:55:06 UTC
dlang/dmd pull request #11377 "fix issue 12490 - No "Error: , has no effect" Error for comma expression LHS" was merged into master:

- 5c4c630ab3be05b3cc3b60165b0e662f5d98eaa9 by Nils Lankila:
  fix issue 12490 - No "Error: , has no effect" Error for comma expression LHS
  
  Following a comment in sideeffect.d on how to check the LHS.

https://github.com/dlang/dmd/pull/11377