Skip to content

Commit fca6fb6

Browse files
Merge pull request #731 from andreasfertig/fixMissingNamespace
Fixed missing namespace if the type appears as a template parameter.
2 parents a4532a5 + bb5d830 commit fca6fb6

File tree

6 files changed

+73
-35
lines changed

6 files changed

+73
-35
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -415,16 +415,16 @@ jobs:
415415
message(FATAL_ERROR "Bad exit status during coverage")
416416
endif()
417417
418-
- name: Upload code coverage info
419-
if: matrix.config.coverage == 'Yes'
420-
uses: codecov/codecov-action@v4
421-
with:
422-
token: ${{ secrets.CODECOV_TOKEN }}
423-
files: ./build/filtered.info # don't use a absolute path on Windows with gitBash.
424-
exclude: build
425-
flags: ${{ matrix.config.archive_name }}
426-
disable_search: true
427-
fail_ci_if_error: true
418+
# - name: Upload code coverage info
419+
# if: matrix.config.coverage == 'Yes'
420+
# uses: codecov/codecov-action@v4
421+
# with:
422+
# token: ${{ secrets.CODECOV_TOKEN }}
423+
# files: ./build/filtered.info # don't use a absolute path on Windows with gitBash.
424+
# exclude: build
425+
# flags: ${{ matrix.config.archive_name }}
426+
# disable_search: true
427+
# fail_ci_if_error: true
428428

429429
- name: Create archive
430430
if: matrix.config.upload == 'Yes'
@@ -583,18 +583,18 @@ jobs:
583583
fi
584584
chmod +x ./codecov
585585
586-
- name: Upload code coverage info
587-
if: matrix.config.coverage == 'Yes'
588-
id: run_coverage_upload
589-
uses: codecov/codecov-action@v5
590-
with:
591-
token: ${{ secrets.CODECOV_TOKEN }}
592-
files: ./build/filtered.info # don't use a absolute path on Windows with gitBash.
593-
exclude: build
594-
flags: ${{ matrix.config.archive_name }}-${{ env.ARCH }}-libcxx-${{ matrix.config.libcxx }}
595-
disable_search: true
596-
fail_ci_if_error: true
597-
binary: ${{ github.workspace }}/codecov # Currently, the docker container comes without gpg
586+
# - name: Upload code coverage info
587+
# if: matrix.config.coverage == 'Yes'
588+
# id: run_coverage_upload
589+
# uses: codecov/codecov-action@v5
590+
# with:
591+
# token: ${{ secrets.CODECOV_TOKEN }}
592+
# files: ./build/filtered.info # don't use a absolute path on Windows with gitBash.
593+
# exclude: build
594+
# flags: ${{ matrix.config.archive_name }}-${{ env.ARCH }}-libcxx-${{ matrix.config.libcxx }}
595+
# disable_search: true
596+
# fail_ci_if_error: true
597+
# binary: ${{ github.workspace }}/codecov # Currently, the docker container comes without gpg
598598

599599
- name: Create archive
600600
if: matrix.config.upload == 'Yes'

CodeGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4635,7 +4635,7 @@ void CodeGenerator::InsertTemplateArg(const TemplateArgument& arg)
46354635
case TemplateArgument::Template: [[fallthrough]];
46364636
case TemplateArgument::TemplateExpansion:
46374637
if(const auto* tmplDecl = arg.getAsTemplateOrTemplatePattern().getAsTemplateDecl()) {
4638-
mOutputFormatHelper.Append(GetName(*tmplDecl));
4638+
mOutputFormatHelper.Append(GetName(*tmplDecl, QualifiedName::Yes));
46394639

46404640
} else if(const auto* depName = arg.getAsTemplateOrTemplatePattern().getAsDependentTemplateName();
46414641
depName->isIdentifier()) {

tests/Namespace2Test.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Test
2+
{
3+
public:
4+
template<typename T>
5+
class my_array {};
6+
7+
// two type template parameters and one template template parameter:
8+
template<template<typename> typename C = my_array>
9+
class Map
10+
{
11+
};
12+
};
13+
14+
15+
int main(){
16+
Test::Map<> a;
17+
}

tests/Namespace2Test.expect

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
class Test
2+
{
3+
4+
public:
5+
template<typename T>
6+
class my_array
7+
{
8+
};
9+
10+
template<template <typename> typename C = my_array>
11+
class Map
12+
{
13+
};
14+
15+
/* First instantiated from: Namespace2Test.cpp:16 */
16+
#ifdef INSIGHTS_USE_TEMPLATE
17+
template<>
18+
class Map<my_array>
19+
{
20+
public:
21+
// inline constexpr Map() noexcept = default;
22+
};
23+
24+
#endif
25+
};
26+
27+
28+
int main()
29+
{
30+
Test::Map<Test::my_array> a;
31+
return 0;
32+
}

tests/NonTypeTemplateParameterPackTest.cerr

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/NonTypeTemplateParameterPackTest.expect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,6 @@ int main()
148148
{
149149
Test t;
150150
t.summ<int, int, int>(1, 2, 3);
151-
Test::Map<int, int, my_array> a;
151+
Test::Map<int, int, Test::my_array> a;
152152
return t.sum<1>();
153153
}

0 commit comments

Comments
 (0)