Skip to content

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

@frederick-vs-ja

Description

@frederick-vs-ja

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions