Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Clang] Fix missed initializer instantiation bug for variable templates #138122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 18, 2025

Conversation

dty2
Copy link
Contributor

@dty2 dty2 commented May 1, 2025

Try to fix missing initializer for inline static template member with auto caused by delayed template instantiation.

Bug Fix: Bug 135032
Problem Description:
Due to nested templates, when instantiating the outer layer (the template class), the inner layer (the template variable) uses delayed instantiation.
This causes the declaration (VarDecl) of the template variable to retain the type from the original template declaration (i.e., auto), and it loses the initializer.
Later, when instantiating the template variable, its VarTemplateSpecializationDecl type depends on the VarDecl type.
Thus, the VarTemplateSpecializationDecl also has no initializer, and its type remains auto.
Ultimately, when building the reference expression in Sema::BuildDeclarationNameExpr, the expression's type is auto and stays as auto until code generation, triggering llvm_unreachable in CodeGenTypes::ConvertType.

Reproduction Steps:
Test Code:

template <typename T> struct B {
  template <typename G> inline static auto var = 5;
};

int main() {
  int bb = B<int>::var<int>;
  return 0;
}

GDB Breakpoints for Debugging:
Annotations like #(1) mark the call order in a tree structure. For example, two #(3) entries mean Sema::CheckVarTemplateId calls Sema::BuildDeclarationNameExpr after its own execution.

#(1)
b Sema::BuildTemplateIdExpr
#(2)
b Sema::CheckVarTemplateId
#(3)
b Sema::CheckVarTemplateId
#(4)
b Sema::BuildVarTemplateInstantiation
#(5)
b TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl
#(6)
b VarTemplateSpecializationDecl::Create
#(7)
b VarTemplateSpecializationDecl::VarTemplateSpecializationDecl
#(8)
b VarDecl::VarDecl
#(6)
b Sema::BuildVariableInstantiation
#(7)
b Sema::InstantiateVariableInitializer
#(3)
b Sema::BuildDeclarationNameExpr
#(4)
b Sema::BuildDeclRefExpr

Key Observations:
While debugging, I generated the AST for the test code and noticed a contradiction:

The AST shows VarTemplateSpecializationDecl as int (correct), but GDB reveals its type is actually auto during execution.

Example from AST:

DeclRefExpr 0x598f651f5a60 <col:9, col:27> 'auto' lvalue VarTemplateSpecialization 0x598f651f5980 'var' 'int' (VarTemplate 0x598f651d1938 'var')
The DeclRefExpr has type auto, while its referenced VarTemplateSpecialization claims to be int—a clear inconsistency.

Solution:
Since I noticed that the deduction of auto type is caused by the initializer
I plan to do special processing for template variables of type auto, that is, to prevent their delayed instantiation
so that their initializers will not be lost when the outer template class is instantiated

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels May 1, 2025
@llvmbot
Copy link
Member

llvmbot commented May 1, 2025

@llvm/pr-subscribers-clang

Author: 执着 (dty2)

Changes

Try to fix missing initializer for inline static template member with auto caused by delayed template instantiation.

Bug Fix: Bug 135032
Problem Description:
Due to nested templates, when instantiating the outer layer (the template class), the inner layer (the template variable) uses delayed instantiation.
This causes the declaration (VarDecl) of the template variable to retain the type from the original template declaration (i.e., auto), and it loses the initializer.
Later, when instantiating the template variable, its VarTemplateSpecializationDecl type depends on the VarDecl type.
Thus, the VarTemplateSpecializationDecl also has no initializer, and its type remains auto.
Ultimately, when building the reference expression in Sema::BuildDeclarationNameExpr, the expression's type is auto and stays as auto until code generation, triggering llvm_unreachable in CodeGenTypes::ConvertType.

Reproduction Steps:
Test Code:

template &lt;typename T&gt; struct B {
  template &lt;typename G&gt; inline static auto var = 5;
};

int main() {
  int bb = B&lt;int&gt;::var&lt;int&gt;;
  return 0;
}

GDB Breakpoints for Debugging:
Annotations like #(1) mark the call order in a tree structure. For example, two #(3) entries mean Sema::CheckVarTemplateId calls Sema::BuildDeclarationNameExpr after its own execution.

#(1)
b Sema::BuildTemplateIdExpr
#(2)
b Sema::CheckVarTemplateId
#(3)
b Sema::CheckVarTemplateId
#(4)
b Sema::BuildVarTemplateInstantiation
#(5)
b TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl
#(6)
b VarTemplateSpecializationDecl::Create
#(7)
b VarTemplateSpecializationDecl::VarTemplateSpecializationDecl
#(8)
b VarDecl::VarDecl
#(6)
b Sema::BuildVariableInstantiation
#(7)
b Sema::InstantiateVariableInitializer
#(3)
b Sema::BuildDeclarationNameExpr
#(4)
b Sema::BuildDeclRefExpr

Key Observations:
While debugging, I generated the AST for the test code and noticed a contradiction:

The AST shows VarTemplateSpecializationDecl as int (correct), but GDB reveals its type is actually auto during execution.

Example from AST:

DeclRefExpr 0x598f651f5a60 <col:9, col:27> 'auto' lvalue VarTemplateSpecialization 0x598f651f5980 'var' 'int' (VarTemplate 0x598f651d1938 'var')
The DeclRefExpr has type auto, while its referenced VarTemplateSpecialization claims to be int—a clear inconsistency.

Solution:
Since I noticed that the deduction of auto type is caused by the initializer
I plan to do special processing for template variables of type auto, that is, to prevent their delayed instantiation
so that their initializers will not be lost when the outer template class is instantiated


Full diff: https://github.com/llvm/llvm-project/pull/138122.diff

3 Files Affected:

  • (modified) clang/lib/Sema/SemaTemplateInstantiateDecl.cpp (+7-1)
  • (modified) clang/test/CodeGenCXX/cxx1z-inline-variables.cpp (+8)
  • (modified) clang/test/SemaTemplate/cxx17-inline-variables.cpp (+6)
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 76c055d28f091..eb66ec34a956f 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -6027,8 +6027,14 @@ void Sema::BuildVariableInstantiation(
   Context.setManglingNumber(NewVar, Context.getManglingNumber(OldVar));
   Context.setStaticLocalNumber(NewVar, Context.getStaticLocalNumber(OldVar));
 
+  bool VarTemplateWithAutoType = false;
+  QualType VarSourceType = OldVar->getTypeSourceInfo()->getType();
+  if (VarSourceType->getAs<AutoType>()) {
+    VarTemplateWithAutoType = true;
+  }
+
   // Figure out whether to eagerly instantiate the initializer.
-  if (InstantiatingVarTemplate || InstantiatingVarTemplatePartialSpec) {
+  if ((InstantiatingVarTemplate && !VarTemplateWithAutoType) || InstantiatingVarTemplatePartialSpec) {
     // We're producing a template. Don't instantiate the initializer yet.
   } else if (NewVar->getType()->isUndeducedType()) {
     // We need the type to complete the declaration of the variable.
diff --git a/clang/test/CodeGenCXX/cxx1z-inline-variables.cpp b/clang/test/CodeGenCXX/cxx1z-inline-variables.cpp
index 812e438f30c9a..b1d8e376b826f 100644
--- a/clang/test/CodeGenCXX/cxx1z-inline-variables.cpp
+++ b/clang/test/CodeGenCXX/cxx1z-inline-variables.cpp
@@ -1,5 +1,13 @@
 // RUN: %clang_cc1 -std=c++1z %s -emit-llvm -o - -triple x86_64-linux-gnu | FileCheck %s
 
+template <typename T> struct B {
+  template <typename G> inline static auto var = 5;
+};
+
+int inlinevartemplate = B<int>::var<int>;
+// CHECK: @_ZN1BIiE3varIiEE = {{.*}}global i32 5{{.*}}comdat
+// CHECK-NOT: @_ZN1BIiE3varIfEE
+
 struct Q {
   // CHECK: @_ZN1Q1kE = linkonce_odr constant i32 5, comdat
   static constexpr int k = 5;
diff --git a/clang/test/SemaTemplate/cxx17-inline-variables.cpp b/clang/test/SemaTemplate/cxx17-inline-variables.cpp
index 7fc0aa8eeeb0c..27067c8e1b5e4 100644
--- a/clang/test/SemaTemplate/cxx17-inline-variables.cpp
+++ b/clang/test/SemaTemplate/cxx17-inline-variables.cpp
@@ -27,3 +27,9 @@ template <typename T> constexpr int A<T>::n = sizeof(A) + sizeof(T);
 template <typename T> inline constexpr int A<T>::m = sizeof(A) + sizeof(T);
 static_assert(A<int>().f() == 5);
 static_assert(A<int>().g() == 5);
+
+template <typename T> struct B {
+  template <typename G> inline static auto var = 5;
+};
+
+int b = B<int>::var<int>;

Copy link

github-actions bot commented May 1, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

Comment on lines 6030 to 6032
bool VarTemplateWithAutoType = false;
QualType VarSourceType = OldVar->getTypeSourceInfo()->getType();
if (VarSourceType->getAs<AutoType>()) {
VarTemplateWithAutoType = true;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bool VarTemplateWithAutoType = false;
QualType VarSourceType = OldVar->getTypeSourceInfo()->getType();
if (VarSourceType->getAs<AutoType>()) {
VarTemplateWithAutoType = true;
}
bool VarTemplateWithAutoType = OldVar->getTypeSourceInfo()->getType()->getAs<AutoType>();

Can we avoid getTypeSourceInfo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your suggestion is correct, I will adopt it.

@zyn0217
Copy link
Contributor

zyn0217 commented May 1, 2025

Also, can you help me test if this fixes #134526? Thanks

@dty2
Copy link
Contributor Author

dty2 commented May 1, 2025

Also, can you help me test if this fixes #134526? Thanks

sure, no problem.

@dty2
Copy link
Contributor Author

dty2 commented May 1, 2025

@zyn0217
I can compile it successfuly, and the output is 1.

#include <iostream>
template <class T>
struct S {
  template <class U> static const auto var = T();
  template <class U> static const auto foo = var<T>;
};

int main() {
  const int p = S<int>::var<int> + S<int>::foo<int> + 1;
  std::cout << p;
  return 0;
}

Copy link
Contributor

@zwuis zwuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a release note in clang/docs/ReleaseNotes.rst .

@@ -6027,8 +6027,15 @@ void Sema::BuildVariableInstantiation(
Context.setManglingNumber(NewVar, Context.getManglingNumber(OldVar));
Context.setStaticLocalNumber(NewVar, Context.getStaticLocalNumber(OldVar));

bool VarTemplateWithAutoType = false;
QualType VarSourceType = OldVar->getTypeSourceInfo()->getType();
if (VarSourceType->getAs<AutoType>()) {
Copy link
Contributor

@zwuis zwuis May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use ->isUndeducedType() to handle this case

template <typename T> struct S { S(T); };
template <typename T> struct B { 
   template <typename G> inline static S var = 5; 
 };

?

Update: And we need to change OldVar-> to NewVar->.

Copy link
Contributor

@zwuis zwuis May 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case makes me thinking that we should swap that two if statements. @dty2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my goodness, I realize my mistake, thank you for your patience in correcting me. You are right.

Comment on lines 6037 to 6032
if ((InstantiatingVarTemplate && !VarTemplateWithAutoType) ||
InstantiatingVarTemplatePartialSpec) {
// We're producing a template. Don't instantiate the initializer yet.
} else if (NewVar->getType()->isUndeducedType()) {
// We need the type to complete the declaration of the variable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that we can just swap these two if statements. We need to handle partial specializations as well. E.g.

template <typename> struct B {
  template <typename, typrname> inline static auto var = 6;
  template <typename T> inline static auto var<int, T> = 7;
};

int b = B<int>::var<int, int>;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review. I think the two if statements should not be swapped, because clang adopts the strategy of delaying template instantiation. If the two if statements are swapped, it will completely violate this strategy. Therefore, I do not plan to swap the two if statements, but only pre-instantiate the template variables of auto type. Of course, if there are other reasons or my understanding is wrong, please let me know and I will consider it again. In addition, thank you again for reminding me to handle some specialized templates, so I modified the if statement to handle this situation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what "strategy" is going to be violated. So you have an example?

@dty2 dty2 force-pushed the clang-bugfix-135032 branch 2 times, most recently from c41f6ff to 75e6e3c Compare May 8, 2025 19:14
Comment on lines 6030 to 6035
bool VarTemplateWithAutoType =
OldVar->getTypeSourceInfo()->getType()->getAs<AutoType>();

// Figure out whether to eagerly instantiate the initializer.
if (InstantiatingVarTemplate || InstantiatingVarTemplatePartialSpec) {
if (!VarTemplateWithAutoType &&
(InstantiatingVarTemplate || InstantiatingVarTemplatePartialSpec)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is special casing AutoType, but this should have the same problem for any DeducedType, like deduced template specializations as well, right?

Wouldn't just swapping the first two branches of the if-else chain here work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I realized my mistake, thank you for correcting me.

@dty2 dty2 force-pushed the clang-bugfix-135032 branch from 75e6e3c to 659cebc Compare May 9, 2025 06:31
@dty2 dty2 requested review from mizvekov, zwuis and zyn0217 May 12, 2025 06:01
Copy link
Contributor

@zwuis zwuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@mizvekov mizvekov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@cor3ntin cor3ntin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for working on this

@dty2 Can you fix the merge conflict? Will you need us to merge that for you?

@zyn0217 zyn0217 changed the title Fix missing initializer for inline static template member with auto caused by delayed template instantiation. [Clang] Fix missing initializer for inline static template member with auto caused by delayed template instantiation May 14, 2025
@zyn0217 zyn0217 changed the title [Clang] Fix missing initializer for inline static template member with auto caused by delayed template instantiation [Clang] Fix missed initializer instantiation bug for variable templates May 14, 2025
template <typename T> struct InlineAuto {
template <typename G> inline static auto var = 5;
};
int inlineauot = InlineAuto<int>::var<int>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inlineauto?

template <typename T> inline static auto var<int, T> = 7;
};

int partialinlineauot = PartialInlineAuto<int>::var<int, int>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Comment on lines 40 to 41
int inlineauot = InlineAuto<int>::var<int>;
int partialinlineauot = PartialInlineAuto<int>::var<int, int>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor

@zyn0217 zyn0217 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM plus nits

@dty2 dty2 force-pushed the clang-bugfix-135032 branch 2 times, most recently from 30b3516 to 673a13b Compare May 18, 2025 04:32
[Clang] Fix missed initializer instantiation bug for variable templates

[Clang] Fix missed initializer instantiation bug for variable templates
@dty2 dty2 force-pushed the clang-bugfix-135032 branch from 673a13b to 7935656 Compare May 18, 2025 04:36
@zyn0217 zyn0217 merged commit 0b553e0 into llvm:main May 18, 2025
11 of 12 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented May 18, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-gcc-ubuntu running on sie-linux-worker3 while building clang at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/174/builds/17946

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
...
PASS: lit :: allow-retries.py (90168 of 90177)
PASS: lit :: discovery.py (90169 of 90177)
PASS: lit :: shtest-external-shell-kill.py (90170 of 90177)
PASS: lit :: googletest-timeout.py (90171 of 90177)
PASS: lit :: selecting.py (90172 of 90177)
PASS: lit :: shtest-timeout.py (90173 of 90177)
PASS: lit :: max-time.py (90174 of 90177)
PASS: lit :: shtest-shell.py (90175 of 90177)
PASS: lit :: shtest-define.py (90176 of 90177)
TIMEOUT: AddressSanitizer-x86_64-linux-dynamic :: TestCases/asan_lsan_deadlock.cpp (90177 of 90177)
******************** TEST 'AddressSanitizer-x86_64-linux-dynamic :: TestCases/asan_lsan_deadlock.cpp' FAILED ********************
Exit Code: -9
Timeout: Reached timeout of 900 seconds

Command Output (stderr):
--
/home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/./bin/clang  --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  -m64  -shared-libasan -O0 /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/compiler-rt/test/asan/TestCases/asan_lsan_deadlock.cpp -o /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/runtimes/runtimes-bins/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Output/asan_lsan_deadlock.cpp.tmp # RUN: at line 4
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -shared-libasan -O0 /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/compiler-rt/test/asan/TestCases/asan_lsan_deadlock.cpp -o /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/runtimes/runtimes-bins/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Output/asan_lsan_deadlock.cpp.tmp
env ASAN_OPTIONS=detect_leaks=1 not  /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/runtimes/runtimes-bins/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Output/asan_lsan_deadlock.cpp.tmp 2>&1 | FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/compiler-rt/test/asan/TestCases/asan_lsan_deadlock.cpp # RUN: at line 5
+ env ASAN_OPTIONS=detect_leaks=1 not /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/runtimes/runtimes-bins/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Output/asan_lsan_deadlock.cpp.tmp
+ FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/compiler-rt/test/asan/TestCases/asan_lsan_deadlock.cpp

--

********************
********************
Timed Out Tests (1):
  AddressSanitizer-x86_64-linux-dynamic :: TestCases/asan_lsan_deadlock.cpp


Testing Time: 1176.93s

Total Discovered Tests: 124717
  Skipped          :     38 (0.03%)
  Unsupported      :   2685 (2.15%)
  Passed           : 121703 (97.58%)
  Expectedly Failed:    290 (0.23%)
  Timed Out        :      1 (0.00%)
FAILED: CMakeFiles/check-all /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/CMakeFiles/check-all 
cd /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build && /usr/bin/python3.8 /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/./bin/llvm-lit --verbose --timeout=900 --param USE_Z3_SOLVER=0 /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/utils/mlgo-utils /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/projects/cross-project-tests /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/tools/lld/test /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/tools/clang/tools/extra/include-cleaner/test /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/tools/clang/tools/extra/test /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/tools/clang/test @/home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/runtimes/runtimes-bins/lit.tests /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/utils/lit /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/test
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented May 18, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-gcc-ubuntu-no-asserts running on doug-worker-6 while building clang at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/202/builds/1299

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: tools/dsymutil/X86/op-convert-offset.test' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
warning: /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/../Inputs/private/tmp/op-convert-offset/op-convert-offset.o: timestamp mismatch between object file (2025-03-11 17:27:45.671531848) and debug map (2022-07-12 20:49:30.000000000)
warning: /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/../Inputs/private/tmp/op-convert-offset/op-convert-offset.o: timestamp mismatch between object file (2025-03-11 17:27:45.671531848) and debug map (2022-07-12 20:49:30.000000000)
warning: cann't read address attribute value.
note: while processing op-convert-offset1.c

--
Command Output (stderr):
--
/home/buildbot/buildbot-root/gcc-no-asserts/build/bin/dsymutil -oso-prepend-path /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/../Inputs /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/../Inputs/private/tmp/op-convert-offset/op-convert-offset -o /home/buildbot/buildbot-root/gcc-no-asserts/build/test/tools/dsymutil/X86/Output/op-convert-offset.test.tmp.dSYM 2>&1 # RUN: at line 23
+ /home/buildbot/buildbot-root/gcc-no-asserts/build/bin/dsymutil -oso-prepend-path /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/../Inputs /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/../Inputs/private/tmp/op-convert-offset/op-convert-offset -o /home/buildbot/buildbot-root/gcc-no-asserts/build/test/tools/dsymutil/X86/Output/op-convert-offset.test.tmp.dSYM
/home/buildbot/buildbot-root/gcc-no-asserts/build/bin/llvm-dwarfdump /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/../Inputs/private/tmp/op-convert-offset/op-convert-offset.o 2>&1 | /home/buildbot/buildbot-root/gcc-no-asserts/build/bin/FileCheck /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/op-convert-offset.test --check-prefix OBJ # RUN: at line 24
+ /home/buildbot/buildbot-root/gcc-no-asserts/build/bin/llvm-dwarfdump /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/../Inputs/private/tmp/op-convert-offset/op-convert-offset.o
+ /home/buildbot/buildbot-root/gcc-no-asserts/build/bin/FileCheck /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/op-convert-offset.test --check-prefix OBJ
/home/buildbot/buildbot-root/gcc-no-asserts/build/bin/llvm-dwarfdump /home/buildbot/buildbot-root/gcc-no-asserts/build/test/tools/dsymutil/X86/Output/op-convert-offset.test.tmp.dSYM 2>&1 | /home/buildbot/buildbot-root/gcc-no-asserts/build/bin/FileCheck /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/op-convert-offset.test --check-prefix DSYM # RUN: at line 25
+ /home/buildbot/buildbot-root/gcc-no-asserts/build/bin/FileCheck /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/op-convert-offset.test --check-prefix DSYM
+ /home/buildbot/buildbot-root/gcc-no-asserts/build/bin/llvm-dwarfdump /home/buildbot/buildbot-root/gcc-no-asserts/build/test/tools/dsymutil/X86/Output/op-convert-offset.test.tmp.dSYM
/home/buildbot/buildbot-root/gcc-no-asserts/build/bin/dsymutil --linker parallel -oso-prepend-path /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/../Inputs   /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/../Inputs/private/tmp/op-convert-offset/op-convert-offset   -o /home/buildbot/buildbot-root/gcc-no-asserts/build/test/tools/dsymutil/X86/Output/op-convert-offset.test.tmp.dSYM 2>&1 # RUN: at line 27
+ /home/buildbot/buildbot-root/gcc-no-asserts/build/bin/dsymutil --linker parallel -oso-prepend-path /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/../Inputs /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/../Inputs/private/tmp/op-convert-offset/op-convert-offset -o /home/buildbot/buildbot-root/gcc-no-asserts/build/test/tools/dsymutil/X86/Output/op-convert-offset.test.tmp.dSYM
/home/buildbot/buildbot-root/gcc-no-asserts/build/bin/llvm-dwarfdump    /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/../Inputs/private/tmp/op-convert-offset/op-convert-offset.o 2>&1    | /home/buildbot/buildbot-root/gcc-no-asserts/build/bin/FileCheck /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/op-convert-offset.test --check-prefix OBJ # RUN: at line 30
+ /home/buildbot/buildbot-root/gcc-no-asserts/build/bin/llvm-dwarfdump /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/../Inputs/private/tmp/op-convert-offset/op-convert-offset.o
+ /home/buildbot/buildbot-root/gcc-no-asserts/build/bin/FileCheck /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/op-convert-offset.test --check-prefix OBJ
/home/buildbot/buildbot-root/gcc-no-asserts/build/bin/llvm-dwarfdump /home/buildbot/buildbot-root/gcc-no-asserts/build/test/tools/dsymutil/X86/Output/op-convert-offset.test.tmp.dSYM 2>&1 | /home/buildbot/buildbot-root/gcc-no-asserts/build/bin/FileCheck /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/op-convert-offset.test --check-prefix DSYM # RUN: at line 33
+ /home/buildbot/buildbot-root/gcc-no-asserts/build/bin/llvm-dwarfdump /home/buildbot/buildbot-root/gcc-no-asserts/build/test/tools/dsymutil/X86/Output/op-convert-offset.test.tmp.dSYM
+ /home/buildbot/buildbot-root/gcc-no-asserts/build/bin/FileCheck /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/op-convert-offset.test --check-prefix DSYM
�[1m/home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/op-convert-offset.test:45:7: �[0m�[0;1;31merror: �[0m�[1mDSYM: expected string not found in input
�[0mDSYM: 0x00000084: DW_TAG_base_type
�[0;1;32m      ^
�[0m�[1m<stdin>:1:1: �[0m�[0;1;30mnote: �[0m�[1mscanning from here
�[0m/home/buildbot/buildbot-root/gcc-no-asserts/build/test/tools/dsymutil/X86/Output/op-convert-offset.test.tmp.dSYM/Contents/Resources/DWARF/op-convert-offset: file format Mach-O 64-bit x86-64
�[0;1;32m^
�[0m�[1m<stdin>:16:1: �[0m�[0;1;30mnote: �[0m�[1mpossible intended match here
�[0m0x0000001e: DW_TAG_base_type
�[0;1;32m^
�[0m
Input file: <stdin>
Check file: /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/llvm/test/tools/dsymutil/X86/op-convert-offset.test

-dump-input=help explains the following input dump.

Input was:
<<<<<<
�[1m�[0m�[0;1;30m            1: �[0m�[1m�[0;1;46m/home/buildbot/buildbot-root/gcc-no-asserts/build/test/tools/dsymutil/X86/Output/op-convert-offset.test.tmp.dSYM/Contents/Resources/DWARF/op-convert-offset: file format Mach-O 64-bit x86-64 �[0m
�[0;1;31mcheck:45'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
�[0m�[0;1;30m            2: �[0m�[1m�[0;1;46m �[0m
�[0;1;31mcheck:45'0     ~
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[clang] Crash instantiating static variable template specialization member of class template
7 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.