QMCPACK / QMCPACK/qmcpack

Stream operator>> for OhmmsContainers accepts nonsense input.

Open
#2,804 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
403
Forks
154
Avg merge
1d 13h
Merged PRs (30d)
90

Description

**Describe the bug**
operator>> for TinyVector, OhmmsMatrix, etc. doesn't really care what you feed it as long as the operator>> to the element type doesn't have an exception. This allows all sorts of invalid input to silently be read in and the code will attempt to use.

This seems like a missed opportunity to catch bugs at several stages.

**To Reproduce**
Steps to reproduce the behavior:
1. versions post [2013release]
2. Take something like
``` xml

```
make it
``` xml

```
or
``` xml

```
You can also put in more ions positions than ions and that is silent.

**Expected behavior**
A clear and concise description of what you expected to happen.
Exception to be thrown if you attempt to initialize a vector or matrix with invalid input.

**System:**
Any

**Additional context**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.