Skip to content

Commit d3d6d1b

Browse files
committed
Merge remote-tracking branch 'upstream/main' into cwg203
2 parents 438d3eb + 05bd7d2 commit d3d6d1b

File tree

410 files changed

+25961
-11172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

410 files changed

+25961
-11172
lines changed

clang/docs/LibASTMatchersReference.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3449,6 +3449,19 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
34493449
</pre></td></tr>
34503450

34513451

3452+
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1DependentScopeDeclRefExpr.html">DependentScopeDeclRefExpr</a>&gt;</td><td class="name" onclick="toggle('hasDependentName0')"><a name="hasDependentName0Anchor">hasDependentName</a></td><td>std::string N</td></tr>
3453+
<tr><td colspan="4" class="doc" id="hasDependentName0"><pre>Matches the dependent name of a DependentScopeDeclRefExpr.
3454+
3455+
Matches the dependent name of a DependentScopeDeclRefExpr
3456+
3457+
Given:
3458+
3459+
template &lt;class T&lt; class X : T { void f() { T::v; } };
3460+
3461+
dependentScopeDeclRefExpr(hasDependentName("v")) matches `T::v`
3462+
</pre></td></tr>
3463+
3464+
34523465
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1CXXDependentScopeMemberExpr.html">CXXDependentScopeMemberExpr</a>&gt;</td><td class="name" onclick="toggle('memberHasSameNameAsBoundNode0')"><a name="memberHasSameNameAsBoundNode0Anchor">memberHasSameNameAsBoundNode</a></td><td>std::string BindingID</td></tr>
34533466
<tr><td colspan="4" class="doc" id="memberHasSameNameAsBoundNode0"><pre>Matches template-dependent, but known, member names against an already-bound
34543467
node

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,9 @@ Bug Fixes to C++ Support
886886
out of a module (which is the case e.g. in MSVC's implementation of ``std`` module). (#GH118218)
887887
- Fixed a pack expansion issue in checking unexpanded parameter sizes. (#GH17042)
888888
- Fixed a bug where captured structured bindings were modifiable inside non-mutable lambda (#GH95081)
889+
- Passing incomplete types to ``__is_base_of`` and other builtin type traits for which the corresponding
890+
standard type trait mandates a complete type is now a hard (non-sfinae-friendly) error
891+
(`LWG3929 <https://wg21.link/LWG3929>`__.) (#GH121278)
889892
- Clang now identifies unexpanded parameter packs within the type constraint on a non-type template parameter. (#GH88866)
890893
- Fixed an issue while resolving type of expression indexing into a pack of values of non-dependent type (#GH121242)
891894

@@ -1116,6 +1119,8 @@ AST Matchers
11161119

11171120
- Add ``dependentTemplateSpecializationType`` matcher to match a dependent template specialization type.
11181121

1122+
- Add ``hasDependentName`` matcher to match the dependent name of a DependentScopeDeclRefExpr.
1123+
11191124
clang-format
11201125
------------
11211126

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3257,6 +3257,17 @@ AST_MATCHER_P(CXXDependentScopeMemberExpr, memberHasSameNameAsBoundNode,
32573257
});
32583258
}
32593259

3260+
/// Matches the dependent name of a DependentScopeDeclRefExpr
3261+
///
3262+
/// Given:
3263+
/// \code
3264+
/// template <class T> class X : T { void f() { T::v; } };
3265+
/// \endcode
3266+
/// \c dependentScopeDeclRefExpr(hasDependentName("v")) matches `T::v`
3267+
AST_MATCHER_P(DependentScopeDeclRefExpr, hasDependentName, std::string, N) {
3268+
return Node.getDeclName().getAsString() == N;
3269+
}
3270+
32603271
/// Matches C++ classes that are directly or indirectly derived from a class
32613272
/// matching \c Base, or Objective-C classes that directly or indirectly
32623273
/// subclass a class matching \c Base.

clang/include/clang/Basic/Builtins.td

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3568,6 +3568,19 @@ def Frexp : FPMathTemplate, LibBuiltin<"math.h"> {
35683568
let AddBuiltinPrefixedAlias = 1;
35693569
}
35703570

3571+
def Sincos : FPMathTemplate, GNULibBuiltin<"math.h"> {
3572+
let Spellings = ["sincos"];
3573+
let Attributes = [NoThrow];
3574+
let Prototype = "void(T, T*, T*)";
3575+
let AddBuiltinPrefixedAlias = 1;
3576+
}
3577+
3578+
def SincosF16F128 : F16F128MathTemplate, Builtin {
3579+
let Spellings = ["__builtin_sincos"];
3580+
let Attributes = [FunctionWithBuiltinPrefix, NoThrow];
3581+
let Prototype = "void(T, T*, T*)";
3582+
}
3583+
35713584
def Ldexp : FPMathTemplate, LibBuiltin<"math.h"> {
35723585
let Spellings = ["ldexp"];
35733586
let Attributes = [NoThrow, ConstIgnoringErrnoAndExceptions];

clang/include/clang/Basic/BuiltinsX86.td

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
include "clang/Basic/BuiltinsBase.td"
14-
15-
class X86Builtin<string prototype> : TargetBuiltin {
16-
let Spellings = ["__builtin_ia32_" # NAME];
17-
let Prototype = prototype;
18-
let EnableOpenCLLong = 1;
19-
}
20-
21-
class X86NoPrefixBuiltin<string prototype> : TargetBuiltin {
22-
let Spellings = [NAME];
23-
let Prototype = prototype;
24-
}
25-
26-
class X86LibBuiltin<string prototype> : TargetLibBuiltin {
27-
let Spellings = [NAME];
28-
let Prototype = prototype;
29-
}
13+
include "clang/Basic/BuiltinsX86Base.td"
3014

3115
def rdpmc : X86Builtin<"unsigned long long int(int)">;
3216
def rdtsc : X86Builtin<"unsigned long long int()">;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//===--- BuiltinsX86Base.td - X86 Builtin function classes ------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This file defines the X86-specific builtin function classes.
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
include "clang/Basic/BuiltinsBase.td"
14+
15+
class X86Builtin<string prototype> : TargetBuiltin {
16+
let Spellings = ["__builtin_ia32_" # NAME];
17+
let Prototype = prototype;
18+
let EnableOpenCLLong = 1;
19+
}
20+
21+
class X86NoPrefixBuiltin<string prototype> : TargetBuiltin {
22+
let Spellings = [NAME];
23+
let Prototype = prototype;
24+
}
25+
26+
class X86LibBuiltin<string prototype> : TargetLibBuiltin {
27+
let Spellings = [NAME];
28+
let Prototype = prototype;
29+
}

0 commit comments

Comments
 (0)