https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119023
Bug ID: 119023
Summary: Problem of try-block scope and maybe gcc before 12
accepts invalid
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: qurong at ios dot ac.cn
Target Milestone: ---
For this program:
template < typename T > class a {
public: int b = 3;
void plugh(int _) try {
int _ = 1;
}
catch (int) {
}
};
int main() {
return 0;
}
This causes an error in clang and gcc≥12, but msvc and gcc<12 didn't report the
error.
Compiler Explorer link: https://godbolt.org/z/ra4v6WqKz