When a class is marked `__declspec(dllexport)`, Clang eagerly creates inherited constructors via `findInheritingConstructor` and propagates the dllexport attribute to all members. This bypasses overload resolution, which would normally filter out constructors whose requires clause is not satisfied. As a result, Clang attempted to instantiate constructor bodies that should never be available, causing spurious compilation errors. Add constraint satisfaction checks in `checkClassLevelDLLAttribute` to match MSVC behavior: 1. Before eagerly creating inherited constructors, verify that the base constructor's `requires` clause is satisfied. Skip creation otherwise. 2. Before applying dllexport to non-inherited methods of class template specializations, verify constraint satisfaction. This handles the case where `dllexport` propagates to a base template specialization whose own members have unsatisfied constraints. Inherited constructors skip the second check since their constraints were already verified at creation time. Fixes #185924 Followup to https://github.com/llvm/llvm-project/pull/182706 Assisted by: Cursor // Claude Opus 4.6
C language Family Front-end
Welcome to Clang.
This is a compiler front-end for the C family of languages (C, C++ and Objective-C) which is built as part of the LLVM compiler infrastructure project.
Unlike many other compiler frontends, Clang is useful for a number of things beyond just compiling code: we intend for Clang to be host to a number of different source-level tools. One example of this is the Clang Static Analyzer.
If you're interested in more (including how to build Clang) it is best to read the relevant websites. Here are some pointers:
-
Information on Clang: http://clang.llvm.org/
-
Building and using Clang: http://clang.llvm.org/get_started.html
-
Clang Static Analyzer: http://clang-analyzer.llvm.org/
-
Information on the LLVM project: http://llvm.org/
-
If you have questions or comments about Clang, a great place to discuss them is on the Clang forums:
-
If you find a bug in Clang, please file it in the LLVM bug tracker: