790 Commits

Author SHA1 Message Date
Chuanqi Xu
0e7b30fa82 [C++20] [Modules] Enhance better diagnostic for implicit global module and module partitions
Due to an oversight, when users use an unexported declaration from
implicit global module, the diagnostic will show "please #include"
instead of "please import". This patch corrects the behavior.

Also previously, when users use an unexported declarations from module
partitions, the diagnostic message will always show the partition name
no matter if that partition name is visible to the users. Now the users
may only see the partition name if the users are in the same module with
the partition unit.
2023-11-10 10:58:07 +08:00
Chuanqi Xu
0f7aaeb324 [C++20] [Modules] Allow export from language linkage
Close https://github.com/llvm/llvm-project/issues/71347

Previously I misread the concept of module purview. I thought if a
declaration attached to a unnamed module, it can't be part of the module
purview. But after the issue report, I recognized that module purview is
more of a concept about locations instead of semantics.

Concretely, the things in the language linkage after module declarations
can be exported.

This patch refactors `Module::isModulePurview()` and introduces some
possible code cleanups.
2023-11-09 17:44:41 +08:00
Jan Svoboda
6966c06bed [clang] NFCI: Use FileEntryRef in suggestPathToFileForDiagnostics() 2023-09-09 20:29:04 -07:00
John Brawn
9e11a6d8fd [Sema] Fix handling of functions that hide classes
When a function is declared in the same scope as a class with the same
name then the function hides that class. Currently this is done by a
single check after the main loop in LookupResult::resolveKind, but
this can give the wrong result when we have a using declaration in
multiple namespace scopes in two different ways:

 * When the using declaration is hidden in one namespace but not the
   other we can end up considering only the hidden one when deciding
   if the result is ambiguous, causing an incorrect "not ambiguous"
   result.

 * When two classes with the same name in different namespace scopes
   are both hidden by using declarations this can result in
   incorrectly deciding the result is ambiguous. There's currently a
   comment saying this is expected, but I don't think that's correct.

Solve this by checking each Decl to see if it's hidden by some other
Decl in the same scope. This means we have to delay removing anything
from Decls until after the main loop, in case a Decl is hidden by
another that is removed due to being non-unique.

Differential Revision: https://reviews.llvm.org/D154503
2023-08-18 12:39:37 +01:00
Kadir Cetinkaya
7d259b36d2
Revert "[Sema] Fix handling of functions that hide classes"
This reverts commit d031ff38779bd688c514136dbdcce3169ee82b6e.
See https://reviews.llvm.org/D154503#4576393 for a reproducer and
details.
2023-08-10 14:06:00 +02:00
David Goldman
9fe632ba18 [clang][HeaderSearch] Treat framework headers as Angled for suggestPath
- Rename the IsSystem flag to be IsAngled since that's how callers
  actually use the flag.

- Since frameworks by convention use <> style includes, make sure
  we treat them as Angled

Also update clangd's custom logic for frameworks accordingly.

Differential Revision: https://reviews.llvm.org/D156704
2023-08-09 15:51:02 -04:00
Corentin Jabot
a8bef8865e [Clang] Implement P2169 A nice placeholder with no name
This is a C++ feature that allows the use of `_` to
declare multiple variable of that name in the same scope;
these variables can then not be referred to.

In addition, while P2169 does not extend to parameter
declarations, we stop warning on unused parameters of that name,
for consistency.

The feature is backported to all C++ language modes.

Reviewed By: #clang-language-wg, aaron.ballman

Differential Revision: https://reviews.llvm.org/D153536
2023-08-04 16:51:15 +02:00
John Brawn
d031ff3877 [Sema] Fix handling of functions that hide classes
When a function is declared in the same scope as a class with the same
name then the function hides that class. Currently this is done by a
single check after the main loop in LookupResult::resolveKind, but
this can give the wrong result when we have a using declaration in
multiple namespace scopes in two different ways:

 * When the using declaration is hidden in one namespace but not the
   other we can end up considering only the hidden one when deciding
   if the result is ambiguous, causing an incorrect "not ambiguous"
   result.

 * When two classes with the same name in different namespace scopes
   are both hidden by using declarations this can result in
   incorrectly deciding the result is ambiguous. There's currently a
   comment saying this is expected, but I don't think that's correct.

Solve this by checking each Decl to see if it's hidden by some other
Decl in the same scope. This means we have to delay removing anything
from Decls until after the main loop, in case a Decl is hidden by
another that is removed due to being non-unique.

Differential Revision: https://reviews.llvm.org/D154503
2023-07-25 12:30:41 +01:00
John Brawn
dc3cd59264 Revert "[Sema] Fix handling of functions that hide classes"
This reverts commit dfca88341794eec88c5009a93c569172fff62635.

Causes clang/test/Modules/stress1.cpp to fail.
2023-07-24 13:30:26 +01:00
John Brawn
dfca883417 [Sema] Fix handling of functions that hide classes
When a function is declared in the same scope as a class with the same
name then the function hides that class. Currently this is done by a
single check after the main loop in LookupResult::resolveKind, but
this can give the wrong result when we have a using declaration in
multiple namespace scopes in two different ways:

 * When the using declaration is hidden in one namespace but not the
   other we can end up considering only the hidden one when deciding
   if the result is ambiguous, causing an incorrect "not ambiguous"
   result.

 * When two classes with the same name in different namespace scopes
   are both hidden by using declarations this can result in
   incorrectly deciding the result is ambiguous. There's currently a
   comment saying this is expected, but I don't think that's correct.

Solve this by checking each Decl to see if it's hidden by some other
Decl in the same scope. This means we have to delay removing anything
from Decls until after the main loop, in case a Decl is hidden by
another that is removed due to being non-unique.

Differential Revision: https://reviews.llvm.org/D154503
2023-07-24 13:11:30 +01:00
eopXD
af19e406f2 [Clang][RISCV] Fix RISC-V vector / SiFive intrinsic inclusion in SemaLookup
The existing code assumes that both `DeclareRISCVVBuiltins` and
`DeclareRISCVSiFiveVectorBuiltins` are set when coming into the if-statement
under SemaLookup.cpp.

This is not the case and causes issue #63571.

This patch resolves the issue.

Reviewed By: 4vtomat, kito-cheng

Differential Revision: https://reviews.llvm.org/D154050
2023-06-29 05:23:56 -07:00
Chuanqi Xu
60eb1da315 [Modules] [Sema] Don't try to getAcceptableDecls during the iteration of noload_lookups
I found this during the support of modules for clangd. The reason for
the issue is that the iterator returned by noload_lookups is fast-fail
after the lookup table changes by the design of llvm::DenseMap. And
originally the lookup will try to use getAcceptableDecl to filter the
invisible decls. The key point here is that the function
"getAcceptableDecl" wouldn't stop after it find the specific decl is
invisble. It will continue to visit its redecls to find a visible one.
However, such process involves loading decls from external sources,
which results the invalidation.

Note that the use of "noload_lookups" is rare. It is only used in tools
like FixTypos and CodeCompletions. So it is completely fine for the
tranditional compiler. This is the reason why I can't reproduce it by a
lit test.
2023-06-09 11:32:06 +08:00
eopXD
382550bf33 [Clang][RISCV] Adjust naming from DeclareRISCVVectorBuiltins to DeclareRISCVSiFiveVectorBuiltins. NFC
The variable indicates if RISC-V Sifive vector builtin functions
are enabled or not. The adjusted naming help clarifies this.

cc: @4vtomat
2023-06-08 10:55:01 -07:00
Chuanqi Xu
52bc4b16cb [NFC] [C++20] [Modules] Refactor Sema::isModuleUnitOfCurrentTU into
Decl::isInAnotherModuleUnit

Refactor `Sema::isModuleUnitOfCurrentTU` to `Decl::isInAnotherModuleUnit`
to make code simpler a little bit. Note that although this patch
introduces a FIXME, this is an existing issue and this patch just tries
to describe it explicitly.
2023-05-23 10:52:22 +08:00
Chuanqi Xu
7f37066915 Revert "[NFC] [C++20] [Modules] Refactor Sema::isModuleUnitOfCurrentTU into"
This reverts commit f109b1016801e2b0dbee278f3c517057c0b1d441 as required
in
f109b10168 (commitcomment-113477829).
2023-05-16 10:47:53 +08:00
Vitaly Buka
ba566fffb2 [NFC][AST] Return void from setUseQualifiedLookup
It uses to initialize the class. If so, it returns uninitalized value.
This is UB and msan with -fno-inline will complain.
2023-05-11 17:13:19 -07:00
Chuanqi Xu
48bbc64a8f [NFC] [C++20] [Modules] Code cleanups when checking modules in ADL
The original code uses getTopLevelModuleName to compare if the module
matches. This is an overkill. Since in one program there will only be at
most one module name. So it is good enough to compare the module
directly. So that we can save some string comparisons.
2023-05-10 17:53:47 +08:00
Chuanqi Xu
b6c7177145 [C++20] [Modules] Don't generate unused variables in other module units
even if its initializer has side effects

Close https://github.com/llvm/llvm-project/issues/61892

The variables whose initializer has side effects will be emitted even if
it is not used. But it shouldn't be true after we introduced modules.
The variables in other modules shouldn't be emitted if it is not used
even if its initializer has size effects.

Also this patch rename `Decl::isInCurrentModuleUnit` to
`Decl::isInAnotherModuleUnit` to make it closer to the semantics.
2023-05-10 17:41:58 +08:00
Chuanqi Xu
f109b10168 [NFC] [C++20] [Modules] Refactor Sema::isModuleUnitOfCurrentTU into
Decl::isInCurrentModuleUnit

Refactor `Sema::isModuleUnitOfCurrentTU` to `Decl::isInCurrentModuleUnit`
to make code simpler a little bit. Note that although this patch
introduces a FIXME, this is an existing issue and this patch just tries
to describe it explicitly.
2023-05-10 16:01:27 +08:00
Chuanqi Xu
60a3784b3e [C++20] [Modules] Handle modules visible relationship properly
Close https://github.com/llvm/llvm-project/issues/62589.

Previously, for global module fragments, we will justify if it is
visible by the visibility of their top level parents. But this is an
overkill, it is problematic if we have a deduction guide in the global
module fragments. See the attached test for example. In this example, we
will mark the global module fragments as visible, but our old strategy
will miss the case surprisingly due to we will only search for the top
level modules.
2023-05-09 18:36:37 +08:00
4vtomat
fa43608d16 [RISCV][RISCV][clang] Split out SiFive Vector C intrinsics from riscv_vector.td
Since we don't always need the vendor extension to be in riscv_vector.td,
so it's better to make it be in separated header.

Depends on D148223 and D148680

Differential Revision: https://reviews.llvm.org/D148308
2023-05-02 05:51:51 -07:00
Timm Bäder
57304bbda2 [clang][Sema][NFC] Add const where appropriate 2023-04-22 08:28:27 +02:00
Timm Bäder
80fda7a346 [clang][Sema][NFC] Make a bunch of things const if possible
And some general code style cleanup.

Differential Revision: https://reviews.llvm.org/D148696
2023-04-20 12:23:51 +02:00
Timm Bäder
455c9efb41 [clang][NFC] Use range-for loop in SemaLookup.cpp 2023-04-17 09:49:04 +02:00
Vlad Serebrennikov
467ed27987 [clang] Extend pragma dump to support expressions
Extend `#pragma clang __debug dump` to support not only single identifier, but an expression as well. This makes it possible to test ADL and overload resolution directly, without being creative to make them observable via diagnostics (e.g. when [[ http://eel.is/c++draft/over.match.best | over.match.best ]] is involved). This implementation has a known limitation of not supporting dependent expressions properly, but it's quite useful even without such support.

Differential Revision: https://reviews.llvm.org/D144115
2023-03-24 17:35:35 +03:00
Chuanqi Xu
5828692f70 [C++20] [Modules] Make TheImplicitGlobalModuleFragment and TheExportedImplicitGlobalModuleFragment to be useable modules
The unexported language linkage become unvisible to the current module
unit after the previous commit bf52ead24ca4. This patch fixes the issue.
2023-03-03 11:15:29 +08:00
Chuanqi Xu
bf52ead24c [C++20] [Modules] Support to export declarations in language linkage
Close https://github.com/llvm/llvm-project/issues/60405

See the discussion in the above link for the background.

What the patch does:
- Rename `Module::ModuleKind::GlobalModuleFragment` to
  `Module::ModuleKind::ExplicitGlobalModuleFragment`.
- Add another module kind `ImplicitGlobalModuleFragment` to
  `ModuleKind`.
- Create an implicit global module fragment for the language linkage
  declarations inside a module purview.
    - If the language linkage lives inside the scope of an export decl,
      the created modules is marked as exported to outer modules.
- In fact, Sema will only create at most 2 implicit global module
  fragments to avoid creating a lot of unnecessary modules in the edging
case.

Reviewed By: iains

Differential Revision: https://reviews.llvm.org/D144367
2023-03-03 10:31:48 +08:00
Chuanqi Xu
c5cb1117e1 [Modules] Handle the visibility of GMF during the template instantiation
Close https://github.com/llvm/llvm-project/issues/60775

Previously, we will mark all the declarations in the GMF as not visible
to other module units. But this is too strict and the users may meet
problems during the template instantiation like the above exampel shows.
The patch addresseds the problem.
2023-02-20 14:19:50 +08:00
Chuanqi Xu
84bf4ab087 [C++20] [Modules] Allow ADL in dependent context for modules
Close https://github.com/llvm/llvm-project/issues/60488.

Previously, when we instantiate a template, the argument dependent
lookup is performed in the context of the instantiation, which implies that the
functions not visible in the context can't be found by the argument
dependent lookup.

But this is not true, according to [module.context]p3, the instantiation
context for the implicit instantiation of a template should contain the
context of the primary module interface if the template is defined in
the module interface unit.

Note that the fix didn't implemnet [module.context]p3 precisely, see the
comments for example.
2023-02-07 14:09:46 +08:00
Kazu Hirata
6ad0788c33 [clang] Use std::optional instead of llvm::Optional (NFC)
This patch replaces (llvm::|)Optional< with std::optional<.  I'll post
a separate patch to remove #include "llvm/ADT/Optional.h".

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2023-01-14 12:31:01 -08:00
Kazu Hirata
a1580d7b59 [clang] Add #include <optional> (NFC)
This patch adds #include <optional> to those files containing
llvm::Optional<...> or Optional<...>.

I'll post a separate patch to actually replace llvm::Optional with
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2023-01-14 11:07:21 -08:00
serge-sans-paille
a3c248db87
Move from llvm::makeArrayRef to ArrayRef deduction guides - clang/ part
This is a follow-up to https://reviews.llvm.org/D140896, split into
several parts as it touches a lot of files.

Differential Revision: https://reviews.llvm.org/D141139
2023-01-09 12:15:24 +01:00
Chuanqi Xu
ee1be28224 [C++20] [Modules] Make placement allocation functions always visible
Close https://github.com/llvm/llvm-project/issues/59601.

This is actually a workaround for the issue. See the comments and the
test for example. The proper fix should make the placement allocation
functions acceptable based on the context. But it is harder and more
complex on the one side. On the other side, such workaround won't be too
bad in practice since users rarely call the placement allocation
functions directly.

So personally I prefer to address such problems in the simpler way.

Reviewed By: royjacobson

Differential Revision: https://reviews.llvm.org/D141023
2023-01-09 10:40:23 +08:00
Benjamin Kramer
e6329388c3 [Sema] Avoid double hash lookup. NFCI 2022-12-30 19:25:38 +01:00
Kazu Hirata
8595f2e54d [Sema] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated.  The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-12-03 11:13:39 -08:00
Aaron Ballman
d7d743621a Reenable POSIX builtin library functions in gnu2x mode
gnu17 and earlier modes automatically expose several POSIX C APIs, and
this was accidentally disabled for gnu2x in
7d644e1215b376ec5e915df9ea2eeb56e2d94626.

This restores the behavior for gnu2x mode (without changing the
behavior in C standards modes instead of GNU modes).

Fixes #56607
2022-11-02 08:00:25 -04:00
Matheus Izvekov
13fd717b22
[clang] Changes to produce sugared converted template arguments
Makes CheckTemplateArgumentList and the template deduction functions
produce a sugared converted argument list in addition to the canonical one.

This is mostly NFC except that we hook this up to a few diagnostics in
SemaOverload.

The infrastructure here will be used in subsequent patches
where we perform a finalized sugared substitution for entities
which we do not unique per specializations on canonical arguments,
and later on will be used for template specialization resugaring.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Differential Revision: https://reviews.llvm.org/D133874
2022-10-27 05:50:00 +02:00
Matheus Izvekov
b1f1ce782c
Revert "[clang] Changes to produce sugared converted template arguments"
This reverts commit 11ce78940b4c6f44ae6ee5a6611d6c9b1bade1c2.
2022-10-26 10:14:40 +02:00
Matheus Izvekov
11ce78940b
[clang] Changes to produce sugared converted template arguments
Makes CheckTemplateArgumentList and the template deduction functions
produce a sugared converted argument list in addition to the canonical one.

This is mostly NFC except that we hook this up to a few diagnostics in
SemaOverload.

The infrastructure here will be used in subsequent patches
where we perform a finalized sugared substitution for entities
which we do not unique per specializations on canonical arguments,
and later on will be used for template specialization resugaring.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Differential Revision: https://reviews.llvm.org/D133874
2022-10-26 02:15:10 +02:00
Kadir Cetinkaya
adab08ecf2
[clang][Sema] Fix crash on invalid base destructor
LookupSpecialMember might fail, so changes the cast to cast_or_null.
Inside Sema, skip a particular base, similar to other cases, rather than
asserting on dtor showing up.

Other option would be to mark classes with invalid destructors as invalid, but
that seems like a lot more invasive and we do lose lots of diagnostics that
currently work on classes with broken members.

Differential Revision: https://reviews.llvm.org/D135254
2022-10-05 15:23:15 +02:00
Xiang Li
782ac2182c [HLSL] Support cbuffer/tbuffer for hlsl.
This is first part for support cbuffer/tbuffer.

The format for cbuffer/tbuffer is
BufferType [Name] [: register(b#)] { VariableDeclaration [: packoffset(c#.xyzw)]; ... };

More details at https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-constants

New keyword 'cbuffer' and 'tbuffer' are added.
New AST node HLSLBufferDecl is added.
Build AST for simple cbuffer/tbuffer without attribute support.

The special thing is variables declared inside cbuffer is exposed into global scope.
So isTransparentContext should return true for HLSLBuffer.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D129883
2022-09-21 10:07:43 -07:00
Kazu Hirata
b7a7aeee90 [clang] Qualify auto in range-based for loops (NFC) 2022-09-03 23:27:27 -07:00
Iain Sandoe
fee3cccc6c [C++20][Modules] Improve handing of Private Module Fragment diagnostics.
This adds a check for exported inline functions, that there is a definition in
the definition domain (which, in practice, can only be the module purview but
before any PMF starts) since the PMF definition domain cannot contain exports.

This is:
[dcl.inline]/7
If an inline function or variable that is attached to a named module is declared in
a definition domain, it shall be defined in that domain.

The patch also amends diagnostic output by excluding the PMF sub-module from the
set considered as sources of missing decls.  There is no point in telling the user
that the import of a PMF object is missing - since such objects are never reachable
to an importer.  We still show the definition (as unreachable), to help point out
this.

Differential Revision: https://reviews.llvm.org/D128328
2022-08-21 10:19:46 +01:00
Kazu Hirata
ec5eab7e87 Use range-based for loops (NFC) 2022-08-20 21:18:32 -07:00
Fangrui Song
3f18f7c007 [clang] LLVM_FALLTHROUGH => [[fallthrough]]. NFC
With C++17 there is no Clang pedantic warning or MSVC C5051.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D131346
2022-08-08 09:12:46 -07:00
Chuanqi Xu
8d91b1da57 [NFC] [C++20] [Modules] Use Sema::isModuleUnitOfCurrentTU to simplify the code 2022-07-27 14:33:28 +08:00
Kito Cheng
7a5cb15ea6 [RISCV] Lazily add RVV C intrinsics.
Leverage the method OpenCL uses that adds C intrinsics when the lookup
failed. There is no need to define C intrinsics in the header file any
more. It could help to avoid the large header file to speed up the
compilation of RVV source code. Besides that, only the C intrinsics used
by the users will be added into the declaration table.

This patch is based on https://reviews.llvm.org/D103228 and inspired by
OpenCL implementation.

### Experimental Results

#### TL;DR:

- Binary size of clang increase ~200k, which is +0.07%  for debug build and +0.13% for release build.
- Single file compilation speed up ~33x for debug build and ~8.5x for release build
- Regression time reduce ~10% (`ninja check-all`, enable all targets)

#### Header size change
```
       |      size |     LoC |
------------------------------
Before | 4,434,725 |  69,749 |
After  |     6,140 |     162 |
```

#### Single File Compilation Time
Testcase:
```
#include <riscv_vector.h>

vint32m1_t test_vadd_vv_vfloat32m1_t(vint32m1_t op1, vint32m1_t op2, size_t vl) {
  return vadd(op1, op2, vl);
}
```
##### Debug build:
Before:
```
real    0m19.352s
user    0m19.252s
sys     0m0.092s
```

After:
```
real    0m0.576s
user    0m0.552s
sys     0m0.024s
```

~33x speed up for debug build

##### Release build:
Before:
```
real    0m0.773s
user    0m0.741s
sys     0m0.032s
```

After:
```
real    0m0.092s
user    0m0.080s
sys     0m0.012s
```

~8.5x speed up for release build

#### Regression time
Note: the failed case is `tools/llvm-debuginfod-find/debuginfod.test` which is unrelated to this patch.

##### Debug build
Before:
```
Testing Time: 1358.38s
  Skipped          :    11
  Unsupported      :   446
  Passed           : 75767
  Expectedly Failed:   190
  Failed           :     1
```
After
```
Testing Time: 1220.29s
  Skipped          :    11
  Unsupported      :   446
  Passed           : 75767
  Expectedly Failed:   190
  Failed           :     1
```
##### Release build
Before:
```
Testing Time: 381.98s
  Skipped          :    12
  Unsupported      :  1407
  Passed           : 74765
  Expectedly Failed:   176
  Failed           :     1
```
After:
```
Testing Time: 346.25s
  Skipped          :    12
  Unsupported      :  1407
  Passed           : 74765
  Expectedly Failed:   176
  Failed           :     1
```

#### Binary size of clang

##### Debug build
Before
```
   text    data     bss     dec     hex filename
335261851       12726004         552812 348540667       14c64efb        bin/clang
```
After
```
   text    data     bss     dec     hex filename
335442803       12798708         552940 348794451       14ca2e53        bin/clang
```
+253K, +0.07% code size

##### Release build
Before
```
   text    data     bss     dec     hex filename
144123975       8374648  483140 152981763       91e5103 bin/clang
```
After
```
   text    data     bss     dec     hex filename
144255762       8447296  483268 153186326       9217016 bin/clang
```
+204K, +0.13%

Authored-by: Kito Cheng <kito.cheng@sifive.com>
Co-Authored-by: Hsiangkai Wang <kai.wang@sifive.com>

Reviewed By: khchen, aaron.ballman

Differential Revision: https://reviews.llvm.org/D111617
2022-07-26 15:47:47 +08:00
Iain Sandoe
25558a1bfd [C++20][Modules] Update ADL to handle basic.lookup.argdep p4 [P1815R2 part 1]
This includes the revised provisions of [basic.lookup.argdep] p4

1. ADL is amended to handle p 4.3 where functions in trasitively imported modules may
become visible when they are exported in the same namespace as a visible type.

2. If a function is in a different modular TU, and has internal-linkage, we invalidate
its entry in an overload set.

[basic.lookup.argdep] p5 ex 2 now passes.

Differential Revision: https://reviews.llvm.org/D129174
2022-07-25 14:28:59 +01:00
Chuanqi Xu
ea623af7c9 [C++20] [Modules] Avoid inifinite loop when iterating default args
Currently, clang may meet an infinite loop in a very tricky case when it
iterates the default args. This patch tries to fix this by adding a
`fixed` check.
2022-07-21 17:25:05 +08:00
Chuanqi Xu
4983fdfec0 [C++20] [Modules] Handle reachability for deduction guide
Previously, we forget to handle reachability for deduction guide.
The deduction guide is a hint to the compiler. And the deduction guide
should be able to use if the corresponding template decl is reachable.
2022-07-18 15:46:26 +08:00