public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109012] New: Repeated error messages when using -std=c++23
@ 2023-03-03 16:33 stevenxia990430 at gmail dot com
2023-03-06 8:26 ` [Bug c++/109012] " rguenth at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: stevenxia990430 at gmail dot com @ 2023-03-03 16:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109012
Bug ID: 109012
Summary: Repeated error messages when using -std=c++23
Product: gcc
Version: 12.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: stevenxia990430 at gmail dot com
Target Milestone: ---
The following incomplete program repeatedly reports the same error message on
GCC 12 with “-std=c++23” flag.
To quickly reproduce: https://gcc.godbolt.org/z/Ehzde5o4T
```
#include <iostream>
template <class T>
myClass<myClass<myClass<myClass<myClass<T>>>>> myFunction(T item)
{
std::cout << "Hello World!";
}
```
So the C++23 parser seems to have a bug. If we remove “-std=c++23” it only
reports the concise error message once: https://gcc.godbolt.org/z/38Gxne859
Additionally, this also occurs for even syntactically invalid code snippets.
For example this code
```
myClass<myClass<myClass<myClass<myClass<int>>>>>((( myFunction(int item)
```
Also observe the same behavior, although clearly it is syntactically invalid.
This correct program compiles in less than 1 second with “g++ -c -std=c++23
correct.cpp”
```
#include <iostream>
template<typename T>
class myClass {
public:
void myFunction(const T item);
};
template <class T>
myClass<myClass<myClass<myClass<myClass<T>>>>> myFunction(T item)
{
std::cout << "Hello World!";
}
```
correct.cpp
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-06 8:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03 16:33 [Bug c++/109012] New: Repeated error messages when using -std=c++23 stevenxia990430 at gmail dot com
2023-03-06 8:26 ` [Bug c++/109012] " rguenth at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).