Skip to content

tests fail on parsing noexcept and decltype in c++17 mode #6090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vmihalko opened this issue May 7, 2021 · 4 comments · Fixed by #6402
Closed

tests fail on parsing noexcept and decltype in c++17 mode #6090

vmihalko opened this issue May 7, 2021 · 4 comments · Fixed by #6402

Comments

@vmihalko
Copy link
Contributor

vmihalko commented May 7, 2021

CBMC version: 5.29
Operating system: Fedora 34
Exact command line resulting in the issue: ctest -L CORE
What behaviour did you expect: all tests pass
What happened instead:
Failed test: regression/cpp/virtual1/

/usr/include/assert.h:69:1: error: parse error before '( true ) __attribute__'
      __THROW __attribute__ ((__noreturn__));
/usr/include/stdio.h:146:1: error: parse error before '( true ) ;'
 extern int remove (const char *__filename) __THROW;
PARSING ERROR

Failed test: regression/cpp/Method_qualifier1

/usr/include/c++/11/x86_64-redhat-linux/bits/c++config.h:2434:1: error: parse error before '; } namespace std'
   typedef decltype(nullptr)        nullptr_t;
/usr/include/assert.h:69:1: error: parse error before '( true ) __attribute__'
      __THROW __attribute__ ((__noreturn__));
PARSING ERROR

The problem is with parsing the noexcept and decltype expressions.

The reason of this problem is GCC 11 uses c++17 by default. If I specify goto-cc -std=c++14/11/03, then the mentioned tests pass.

@martin-cs
Copy link
Collaborator

I don't have a GCC 11 handy so is there any chance you could see if this:

#6144

fixes the problem.

martin-cs pushed a commit to martin-cs/cbmc that referenced this issue May 24, 2021
@lzaoral
Copy link
Contributor

lzaoral commented Oct 17, 2021

Hi @martin-cs! Sorry for bumping but I've tried the correct solution proposed in #6144. I've run into some problems that I have described in a commentary in the aforementioned PR.

@martin-cs
Copy link
Collaborator

Thanks @lzaoral I will chase them down there. I think @tautschnig 's patch was better than #6144 .

@martin-cs
Copy link
Collaborator

See #6402

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants