-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Closed
Labels
accepts-invalidbugzillaIssues migrated from bugzillaIssues migrated from bugzillac++14clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
Bugzilla Link | 52434 |
Version | trunk |
OS | Windows NT |
Reporter | LLVM Bugzilla Contributor |
CC | @zygoloid |
Extended Description
This code is invalid:
struct S {
template<class=void>
operator auto() const { return 2; }
};
int main() {
S s;
[[maybe_unused]] int d = s;
}
because the standard explicitly prohibits conversion function template having a deduced return type:
https://timsong-cpp.github.io/cppwp/n4861/class.conv.fct#6
But now Clang accepts the program:
https://gcc.godbolt.org/z/rMK4zboEd
which is a bug.
Metadata
Metadata
Assignees
Labels
accepts-invalidbugzillaIssues migrated from bugzillaIssues migrated from bugzillac++14clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"