Skip to content

[Clang] -fno-exceptions not respected in combination with -fopenmp #147515

@kalvdans

Description

@kalvdans

I tried to compile

#include <stdexcept>

int f() {
    throw std::invalid_argument("hej");
}

with clang -O2 -fopenmp -fno-exceptions -c test.cpp and it works. If I remove the -fopenmp flag it correctly fails since we can't throw without exceptions being turned on.

Reproduced on godbolt with clang-19.1.0 and clang-20.1.0. Not reproducable with gcc 15.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:openmpOpenMP related changes to Clang

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions