Skip to content
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

clang: Different rules for instantiation of dynamic exception specifications in C++03 and C++11 modes #56439

Open
frederick-vs-ja opened this issue Jul 8, 2022 · 2 comments
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@frederick-vs-ja
Copy link
Contributor

frederick-vs-ja commented Jul 8, 2022

Clang currently (since at least 3.1) accepts this program (made well-formed via CWG1330) in C++11 mode but rejects it in C++03 mode.

Godbolt links: acception, rejection.

template<class X>
struct Trans {
    typedef int type;
};

template<class X>
struct Trans<X*> {
    typedef void type;
};

template<class X>
struct Bar {
    void fun() const throw(typename Trans<X>::type);
};

int main()
{
    Bar<int*> bar = Bar<int*>();
}

It's unclear to me why clang doesn't apply the resolution of CWG1330 to C++03 mode.

@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" and removed new issue labels Jul 8, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented Jul 8, 2022

@llvm/issue-subscribers-clang-frontend

@zyn0217
Copy link
Contributor

zyn0217 commented Jan 16, 2024

@shafik Do you think we should port the CWG 1330 implementation to C++03?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

4 participants