C++: Add struct and variable template tests

This commit is contained in:
Jeroen Ketema
2026-03-25 16:31:28 +01:00
parent dad517ff5e
commit 346ab9d623
9 changed files with 342 additions and 0 deletions

View File

@@ -25733,6 +25733,77 @@ ir.cpp:
# 2901| getQualifier(): [ThisExpr] this
# 2901| Type = [PointerType] StructInit *
# 2901| ValueCategory = prvalue(load)
# 2905| [Constructor] void StructInitFromTemplate<int>::StructInitFromTemplate()
# 2905| <params>:
# 2905| <initializations>:
# 2905| getInitializer(0): [ConstructorDefaultFieldInit] constructor init of field t
# 2905| Type = [IntType] int
# 2905| ValueCategory = prvalue
# 2905| getEntryPoint(): [BlockStmt] { ... }
# 2905| getStmt(0): [ReturnStmt] return ...
# 2909| [GlobalVariable] StructInitFromTemplate<int> StructInitFromTemplateVar
#-----| getInitializer(): [Initializer] initializer for StructInitFromTemplateVar
#-----| getExpr(): [ConstructorCall] call to StructInitFromTemplate
#-----| Type = [VoidType] void
#-----| ValueCategory = prvalue
#-----| getExpr().getFullyConverted(): [TemporaryObjectExpr] temporary object
#-----| Type = [ClassTemplateInstantiation,Struct] StructInitFromTemplate<int>
#-----| ValueCategory = prvalue(load)
# 2912| [GlobalVariable,VariableTemplateInstantiation] double VariableTemplate<double>
# 2912| getInitializer(): [Initializer] initializer for VariableTemplate
# 2912| getExpr(): [Literal] 42
# 2912| Type = [IntType] int
# 2912| Value = [Literal] 42
# 2912| ValueCategory = prvalue
# 2912| getExpr().getFullyConverted(): [CStyleCast] (double)...
# 2912| Conversion = [IntegralToFloatingPointConversion] integral to floating point conversion
# 2912| Type = [DoubleType] double
# 2912| Value = [CStyleCast] 42.0
# 2912| ValueCategory = prvalue
# 2915| [TemplateFunction,TopLevelFunction] T VariableTemplateFunc<T>(T)
# 2915| <params>:
# 2915| getParameter(0): [Parameter] x
# 2915| Type = [TypeTemplateParameter] T
# 2915| getEntryPoint(): [BlockStmt] { ... }
# 2916| getStmt(0): [ReturnStmt] return ...
# 2916| getExpr(): [AddExpr] ... + ...
# 2916| Type = [UnknownType] unknown
# 2916| ValueCategory = prvalue
# 2916| getLeftOperand(): [VariableAccess] VariableTemplate
# 2916| Type = [UnknownType] unknown
# 2916| ValueCategory = lvalue
# 2916| getRightOperand(): [VariableAccess] x
# 2916| Type = [TypeTemplateParameter] T
# 2916| ValueCategory = lvalue
# 2915| [FunctionTemplateInstantiation,TopLevelFunction] double VariableTemplateFunc<double>(double)
# 2915| <params>:
# 2915| getParameter(0): [Parameter] x
# 2915| Type = [DoubleType] double
# 2915| getEntryPoint(): [BlockStmt] { ... }
# 2916| getStmt(0): [ReturnStmt] return ...
# 2916| getExpr(): [AddExpr] ... + ...
# 2916| Type = [DoubleType] double
# 2916| ValueCategory = prvalue
# 2916| getLeftOperand(): [VariableAccess] VariableTemplate
# 2916| Type = [DoubleType] double
# 2916| Value = [VariableAccess] 42.0
# 2916| ValueCategory = prvalue(load)
# 2916| getRightOperand(): [VariableAccess] x
# 2916| Type = [DoubleType] double
# 2916| ValueCategory = prvalue(load)
# 2919| [GlobalVariable] int VariableTemplateFuncUse
# 2919| getInitializer(): [Initializer] initializer for VariableTemplateFuncUse
# 2919| getExpr(): [FunctionCall] call to VariableTemplateFunc
# 2919| Type = [DoubleType] double
# 2919| ValueCategory = prvalue
# 2919| getArgument(0): [Literal] 2.299999999999999822
# 2919| Type = [DoubleType] double
# 2919| Value = [Literal] 2.299999999999999822
# 2919| ValueCategory = prvalue
# 2919| getExpr().getFullyConverted(): [CStyleCast] (int)...
# 2919| Conversion = [FloatingPointToIntegralConversion] floating point to integral conversion
# 2919| Type = [IntType] int
# 2919| ValueCategory = prvalue
ir23.cpp:
# 1| [TopLevelFunction] bool consteval_1()
# 1| <params>:

View File

@@ -21658,6 +21658,133 @@ ir.cpp:
# 2901| v2901_18(void) = AliasedUse : m2901_3
# 2901| v2901_19(void) = ExitFunction :
# 2905| void StructInitFromTemplate<int>::StructInitFromTemplate()
# 2905| Block 0
# 2905| v2905_1(void) = EnterFunction :
# 2905| m2905_2(unknown) = AliasedDefinition :
# 2905| m2905_3(unknown) = InitializeNonLocal :
# 2905| m2905_4(unknown) = Chi : total:m2905_2, partial:m2905_3
# 2905| r2905_5(glval<unknown>) = VariableAddress[#this] :
# 2905| m2905_6(glval<StructInitFromTemplate<int>>) = InitializeParameter[#this] : &:r2905_5
# 2905| r2905_7(glval<StructInitFromTemplate<int>>) = Load[#this] : &:r2905_5, m2905_6
# 2905| m2905_8(StructInitFromTemplate<int>) = InitializeIndirection[#this] : &:r2905_7
# 2905| m2905_9(unknown) = Chi : total:m2905_4, partial:m2905_8
# 2905| r2905_10(glval<unknown>) = FunctionAddress[t] :
# 2905| v2905_11(void) = Call[t] : func:r2905_10, this:r2905_7
# 2905| m2905_12(unknown) = ^CallSideEffect : ~m2905_9
# 2905| m2905_13(unknown) = Chi : total:m2905_9, partial:m2905_12
# 2905| v2905_14(void) = ^IndirectReadSideEffect[-1] : &:r2905_7, ~m2905_13
# 2905| m2905_15(StructInitFromTemplate<int>) = ^IndirectMayWriteSideEffect[-1] : &:r2905_7
# 2905| m2905_16(unknown) = Chi : total:m2905_13, partial:m2905_15
# 2905| v2905_17(void) = NoOp :
# 2905| v2905_18(void) = ReturnIndirection[#this] : &:r2905_7, ~m2905_16
# 2905| v2905_19(void) = ReturnVoid :
# 2905| v2905_20(void) = AliasedUse : ~m2905_16
# 2905| v2905_21(void) = ExitFunction :
# 2906| T StructInitFromTemplate<T>::t
# 2906| Block 0
# 2906| v2906_1(void) = EnterFunction :
# 2906| m2906_2(unknown) = AliasedDefinition :
# 2906| m2906_3(unknown) = InitializeNonLocal :
# 2906| m2906_4(unknown) = Chi : total:m2906_2, partial:m2906_3
# 2906| r2906_5(glval<unknown>) = VariableAddress[#this] :
# 2906| m2906_6(glval<StructInitFromTemplate<T>>) = InitializeParameter[#this] : &:r2906_5
# 2906| r2906_7(glval<StructInitFromTemplate<T>>) = Load[#this] : &:r2906_5, m2906_6
# 2906| m2906_8(StructInitFromTemplate<T>) = InitializeIndirection[#this] : &:r2906_7
# 2906| r2906_9(glval<T>) = FieldAddress[t] : r2906_7
# 2906| r2906_10(glval<T>) = VariableAddress :
# 2906| int StructInitFromTemplate<int>::t
# 2906| Block 0
# 2906| v2906_1(void) = EnterFunction :
# 2906| m2906_2(unknown) = AliasedDefinition :
# 2906| m2906_3(unknown) = InitializeNonLocal :
# 2906| m2906_4(unknown) = Chi : total:m2906_2, partial:m2906_3
# 2906| r2906_5(glval<unknown>) = VariableAddress[#this] :
# 2906| m2906_6(glval<StructInitFromTemplate<int>>) = InitializeParameter[#this] : &:r2906_5
# 2906| r2906_7(glval<StructInitFromTemplate<int>>) = Load[#this] : &:r2906_5, m2906_6
# 2906| m2906_8(StructInitFromTemplate<int>) = InitializeIndirection[#this] : &:r2906_7
# 2906| r2906_9(glval<int>) = FieldAddress[t] : r2906_7
# 2906| r2906_10(glval<int>) = VariableAddress[#temp2906:11] :
# 2906| r2906_11(int) = Constant[0] :
# 2906| m2906_12(int) = Store[#temp2906:11] : &:r2906_10, r2906_11
# 2906| r2906_13(int) = Load[#temp2906:11] : &:r2906_10, m2906_12
# 2906| m2906_14(int) = Store[?] : &:r2906_9, r2906_13
# 2906| m2906_15(unknown) = Chi : total:m2906_8, partial:m2906_14
# 2906| v2906_16(void) = ReturnVoid :
# 2906| v2906_17(void) = AliasedUse : m2906_3
# 2906| v2906_18(void) = ExitFunction :
# 2909| StructInitFromTemplate<int> StructInitFromTemplateVar
# 2909| Block 0
# 2909| v2909_1(void) = EnterFunction :
# 2909| m2909_2(unknown) = AliasedDefinition :
# 2909| r2909_3(glval<StructInitFromTemplate<int>>) = VariableAddress[StructInitFromTemplateVar] :
#-----| r0_1(glval<StructInitFromTemplate<int>>) = VariableAddress[#temp0:0] :
#-----| m0_2(StructInitFromTemplate<int>) = Uninitialized[#temp0:0] : &:r0_1
#-----| m0_3(unknown) = Chi : total:m2909_2, partial:m0_2
#-----| r0_4(glval<unknown>) = FunctionAddress[StructInitFromTemplate] :
#-----| v0_5(void) = Call[StructInitFromTemplate] : func:r0_4, this:r0_1
#-----| m0_6(unknown) = ^CallSideEffect : ~m0_3
#-----| m0_7(unknown) = Chi : total:m0_3, partial:m0_6
#-----| m0_8(StructInitFromTemplate<int>) = ^IndirectMayWriteSideEffect[-1] : &:r0_1
#-----| m0_9(unknown) = Chi : total:m0_7, partial:m0_8
#-----| r0_10(StructInitFromTemplate<int>) = Load[#temp0:0] : &:r0_1, ~m0_9
#-----| m0_11(StructInitFromTemplate<int>) = Store[StructInitFromTemplateVar] : &:r2909_3, r0_10
#-----| m0_12(unknown) = Chi : total:m0_9, partial:m0_11
# 2909| v2909_4(void) = ReturnVoid :
# 2909| v2909_5(void) = AliasedUse : ~m0_12
# 2909| v2909_6(void) = ExitFunction :
# 2912| double VariableTemplate<double>
# 2912| Block 0
# 2912| v2912_1(void) = EnterFunction :
# 2912| m2912_2(unknown) = AliasedDefinition :
# 2912| r2912_3(glval<double>) = VariableAddress[VariableTemplate] :
# 2912| r2912_4(double) = Constant[42.0] :
# 2912| m2912_5(double) = Store[VariableTemplate] : &:r2912_3, r2912_4
# 2912| m2912_6(unknown) = Chi : total:m2912_2, partial:m2912_5
# 2912| v2912_7(void) = ReturnVoid :
# 2912| v2912_8(void) = AliasedUse : ~m2912_6
# 2912| v2912_9(void) = ExitFunction :
# 2915| double VariableTemplateFunc<double>(double)
# 2915| Block 0
# 2915| v2915_1(void) = EnterFunction :
# 2915| m2915_2(unknown) = AliasedDefinition :
# 2915| m2915_3(unknown) = InitializeNonLocal :
# 2915| m2915_4(unknown) = Chi : total:m2915_2, partial:m2915_3
# 2915| r2915_5(glval<double>) = VariableAddress[x] :
# 2915| m2915_6(double) = InitializeParameter[x] : &:r2915_5
# 2916| r2916_1(glval<double>) = VariableAddress[#return] :
# 2916| r2916_2(double) = Constant[42.0] :
# 2916| r2916_3(glval<double>) = VariableAddress[x] :
# 2916| r2916_4(double) = Load[x] : &:r2916_3, m2915_6
# 2916| r2916_5(double) = Add : r2916_2, r2916_4
# 2916| m2916_6(double) = Store[#return] : &:r2916_1, r2916_5
# 2915| r2915_7(glval<double>) = VariableAddress[#return] :
# 2915| v2915_8(void) = ReturnValue : &:r2915_7, m2916_6
# 2915| v2915_9(void) = AliasedUse : m2915_3
# 2915| v2915_10(void) = ExitFunction :
# 2919| int VariableTemplateFuncUse
# 2919| Block 0
# 2919| v2919_1(void) = EnterFunction :
# 2919| m2919_2(unknown) = AliasedDefinition :
# 2919| r2919_3(glval<int>) = VariableAddress[VariableTemplateFuncUse] :
# 2919| r2919_4(glval<unknown>) = FunctionAddress[VariableTemplateFunc] :
# 2919| r2919_5(double) = Constant[2.299999999999999822] :
# 2919| r2919_6(double) = Call[VariableTemplateFunc] : func:r2919_4, 0:r2919_5
# 2919| m2919_7(unknown) = ^CallSideEffect : ~m2919_2
# 2919| m2919_8(unknown) = Chi : total:m2919_2, partial:m2919_7
# 2919| r2919_9(int) = Convert : r2919_6
# 2919| m2919_10(int) = Store[VariableTemplateFuncUse] : &:r2919_3, r2919_9
# 2919| m2919_11(unknown) = Chi : total:m2919_8, partial:m2919_10
# 2919| v2919_12(void) = ReturnVoid :
# 2919| v2919_13(void) = AliasedUse : ~m2919_11
# 2919| v2919_14(void) = ExitFunction :
ir23.cpp:
# 1| bool consteval_1()
# 1| Block 0

View File

@@ -6,6 +6,7 @@ missingOperandType
duplicateChiOperand
sideEffectWithoutPrimary
instructionWithoutSuccessor
| ir.cpp:2906:11:2906:13 | VariableAddress: temporary object | Instruction 'VariableAddress: temporary object' has no successors in function '$@'. | ir.cpp:2906:7:2906:7 | T StructInitFromTemplate<T>::t | T StructInitFromTemplate<T>::t |
ambiguousSuccessors
unexplainedLoop
unnecessaryPhiInstruction
@@ -29,5 +30,6 @@ fieldAddressOnNonPointer
thisArgumentIsNonPointer
| ir.cpp:2548:34:2548:34 | Call: call to operator bool | Call instruction 'Call: call to operator bool' has a `this` argument operand that is not an address, in function '$@'. | ir.cpp:2547:6:2547:23 | void this_inconsistency(bool) | void this_inconsistency(bool) |
nonUniqueIRVariable
| ir.cpp:2906:11:2906:13 | VariableAddress: temporary object | Variable address instruction 'VariableAddress: temporary object' has no associated variable, in function '$@'. | ir.cpp:2906:7:2906:7 | T StructInitFromTemplate<T>::t | T StructInitFromTemplate<T>::t |
nonBooleanOperand
missingCppType

View File

@@ -6,6 +6,7 @@ missingOperandType
duplicateChiOperand
sideEffectWithoutPrimary
instructionWithoutSuccessor
| ir.cpp:2906:11:2906:13 | VariableAddress: temporary object | Instruction 'VariableAddress: temporary object' has no successors in function '$@'. | ir.cpp:2906:7:2906:7 | T StructInitFromTemplate<T>::t | T StructInitFromTemplate<T>::t |
ambiguousSuccessors
unexplainedLoop
unnecessaryPhiInstruction
@@ -29,5 +30,6 @@ fieldAddressOnNonPointer
thisArgumentIsNonPointer
| ir.cpp:2548:34:2548:34 | Call: call to operator bool | Call instruction 'Call: call to operator bool' has a `this` argument operand that is not an address, in function '$@'. | ir.cpp:2547:6:2547:23 | void this_inconsistency(bool) | void this_inconsistency(bool) |
nonUniqueIRVariable
| ir.cpp:2906:11:2906:13 | VariableAddress: temporary object | Variable address instruction 'VariableAddress: temporary object' has no associated variable, in function '$@'. | ir.cpp:2906:7:2906:7 | T StructInitFromTemplate<T>::t | T StructInitFromTemplate<T>::t |
nonBooleanOperand
missingCppType

View File

@@ -2901,4 +2901,21 @@ struct StructInit {
int get_val() { return k; }
};
template<typename T>
struct StructInitFromTemplate {
T t = T();
};
StructInitFromTemplate<int> StructInitFromTemplateVar;
template<class T>
constexpr T VariableTemplate = T(42);
template<class T>
T VariableTemplateFunc(T x) {
return VariableTemplate<T> + x;
}
int VariableTemplateFuncUse = VariableTemplateFunc(2.3);
// semmle-extractor-options: -std=c++20 --clang

View File

@@ -6,6 +6,7 @@ missingOperandType
duplicateChiOperand
sideEffectWithoutPrimary
instructionWithoutSuccessor
| ir.cpp:2906:11:2906:13 | VariableAddress: temporary object | Instruction 'VariableAddress: temporary object' has no successors in function '$@'. | ir.cpp:2906:7:2906:7 | T StructInitFromTemplate<T>::t | T StructInitFromTemplate<T>::t |
ambiguousSuccessors
unexplainedLoop
unnecessaryPhiInstruction
@@ -29,5 +30,6 @@ fieldAddressOnNonPointer
thisArgumentIsNonPointer
| ir.cpp:2548:34:2548:34 | Call: call to operator bool | Call instruction 'Call: call to operator bool' has a `this` argument operand that is not an address, in function '$@'. | ir.cpp:2547:6:2547:23 | void this_inconsistency(bool) | void this_inconsistency(bool) |
nonUniqueIRVariable
| ir.cpp:2906:11:2906:13 | VariableAddress: temporary object | Variable address instruction 'VariableAddress: temporary object' has no associated variable, in function '$@'. | ir.cpp:2906:7:2906:7 | T StructInitFromTemplate<T>::t | T StructInitFromTemplate<T>::t |
nonBooleanOperand
missingCppType

View File

@@ -19677,6 +19677,123 @@ ir.cpp:
# 2901| v2901_17(void) = AliasedUse : ~m?
# 2901| v2901_18(void) = ExitFunction :
# 2905| void StructInitFromTemplate<int>::StructInitFromTemplate()
# 2905| Block 0
# 2905| v2905_1(void) = EnterFunction :
# 2905| mu2905_2(unknown) = AliasedDefinition :
# 2905| mu2905_3(unknown) = InitializeNonLocal :
# 2905| r2905_4(glval<unknown>) = VariableAddress[#this] :
# 2905| mu2905_5(glval<StructInitFromTemplate<int>>) = InitializeParameter[#this] : &:r2905_4
# 2905| r2905_6(glval<StructInitFromTemplate<int>>) = Load[#this] : &:r2905_4, ~m?
# 2905| mu2905_7(StructInitFromTemplate<int>) = InitializeIndirection[#this] : &:r2905_6
# 2905| r2905_8(glval<unknown>) = FunctionAddress[t] :
# 2905| v2905_9(void) = Call[t] : func:r2905_8, this:r2905_6
# 2905| mu2905_10(unknown) = ^CallSideEffect : ~m?
# 2905| v2905_11(void) = ^IndirectReadSideEffect[-1] : &:r2905_6, ~m?
# 2905| mu2905_12(StructInitFromTemplate<int>) = ^IndirectMayWriteSideEffect[-1] : &:r2905_6
# 2905| v2905_13(void) = NoOp :
# 2905| v2905_14(void) = ReturnIndirection[#this] : &:r2905_6, ~m?
# 2905| v2905_15(void) = ReturnVoid :
# 2905| v2905_16(void) = AliasedUse : ~m?
# 2905| v2905_17(void) = ExitFunction :
# 2906| T StructInitFromTemplate<T>::t
# 2906| Block 0
# 2906| v2906_1(void) = EnterFunction :
# 2906| mu2906_2(unknown) = AliasedDefinition :
# 2906| mu2906_3(unknown) = InitializeNonLocal :
# 2906| r2906_4(glval<unknown>) = VariableAddress[#this] :
# 2906| mu2906_5(glval<StructInitFromTemplate<T>>) = InitializeParameter[#this] : &:r2906_4
# 2906| r2906_6(glval<StructInitFromTemplate<T>>) = Load[#this] : &:r2906_4, ~m?
# 2906| mu2906_7(StructInitFromTemplate<T>) = InitializeIndirection[#this] : &:r2906_6
# 2906| r2906_8(glval<T>) = FieldAddress[t] : r2906_6
# 2906| r2906_9(glval<T>) = VariableAddress :
# 2906| Block 1
# 2906| v2906_10(void) = ReturnVoid :
# 2906| v2906_11(void) = AliasedUse : ~m?
# 2906| v2906_12(void) = ExitFunction :
# 2906| int StructInitFromTemplate<int>::t
# 2906| Block 0
# 2906| v2906_1(void) = EnterFunction :
# 2906| mu2906_2(unknown) = AliasedDefinition :
# 2906| mu2906_3(unknown) = InitializeNonLocal :
# 2906| r2906_4(glval<unknown>) = VariableAddress[#this] :
# 2906| mu2906_5(glval<StructInitFromTemplate<int>>) = InitializeParameter[#this] : &:r2906_4
# 2906| r2906_6(glval<StructInitFromTemplate<int>>) = Load[#this] : &:r2906_4, ~m?
# 2906| mu2906_7(StructInitFromTemplate<int>) = InitializeIndirection[#this] : &:r2906_6
# 2906| r2906_8(glval<int>) = FieldAddress[t] : r2906_6
# 2906| r2906_9(glval<int>) = VariableAddress[#temp2906:11] :
# 2906| r2906_10(int) = Constant[0] :
# 2906| mu2906_11(int) = Store[#temp2906:11] : &:r2906_9, r2906_10
# 2906| r2906_12(int) = Load[#temp2906:11] : &:r2906_9, ~m?
# 2906| mu2906_13(int) = Store[?] : &:r2906_8, r2906_12
# 2906| v2906_14(void) = ReturnVoid :
# 2906| v2906_15(void) = AliasedUse : ~m?
# 2906| v2906_16(void) = ExitFunction :
# 2909| StructInitFromTemplate<int> StructInitFromTemplateVar
# 2909| Block 0
# 2909| v2909_1(void) = EnterFunction :
# 2909| mu2909_2(unknown) = AliasedDefinition :
# 2909| r2909_3(glval<StructInitFromTemplate<int>>) = VariableAddress[StructInitFromTemplateVar] :
#-----| r0_1(glval<StructInitFromTemplate<int>>) = VariableAddress[#temp0:0] :
#-----| mu0_2(StructInitFromTemplate<int>) = Uninitialized[#temp0:0] : &:r0_1
#-----| r0_3(glval<unknown>) = FunctionAddress[StructInitFromTemplate] :
#-----| v0_4(void) = Call[StructInitFromTemplate] : func:r0_3, this:r0_1
#-----| mu0_5(unknown) = ^CallSideEffect : ~m?
#-----| mu0_6(StructInitFromTemplate<int>) = ^IndirectMayWriteSideEffect[-1] : &:r0_1
#-----| r0_7(StructInitFromTemplate<int>) = Load[#temp0:0] : &:r0_1, ~m?
#-----| mu0_8(StructInitFromTemplate<int>) = Store[StructInitFromTemplateVar] : &:r2909_3, r0_7
# 2909| v2909_4(void) = ReturnVoid :
# 2909| v2909_5(void) = AliasedUse : ~m?
# 2909| v2909_6(void) = ExitFunction :
# 2912| double VariableTemplate<double>
# 2912| Block 0
# 2912| v2912_1(void) = EnterFunction :
# 2912| mu2912_2(unknown) = AliasedDefinition :
# 2912| r2912_3(glval<double>) = VariableAddress[VariableTemplate] :
# 2912| r2912_4(double) = Constant[42.0] :
# 2912| mu2912_5(double) = Store[VariableTemplate] : &:r2912_3, r2912_4
# 2912| v2912_6(void) = ReturnVoid :
# 2912| v2912_7(void) = AliasedUse : ~m?
# 2912| v2912_8(void) = ExitFunction :
# 2915| double VariableTemplateFunc<double>(double)
# 2915| Block 0
# 2915| v2915_1(void) = EnterFunction :
# 2915| mu2915_2(unknown) = AliasedDefinition :
# 2915| mu2915_3(unknown) = InitializeNonLocal :
# 2915| r2915_4(glval<double>) = VariableAddress[x] :
# 2915| mu2915_5(double) = InitializeParameter[x] : &:r2915_4
# 2916| r2916_1(glval<double>) = VariableAddress[#return] :
# 2916| r2916_2(double) = Constant[42.0] :
# 2916| r2916_3(glval<double>) = VariableAddress[x] :
# 2916| r2916_4(double) = Load[x] : &:r2916_3, ~m?
# 2916| r2916_5(double) = Add : r2916_2, r2916_4
# 2916| mu2916_6(double) = Store[#return] : &:r2916_1, r2916_5
# 2915| r2915_6(glval<double>) = VariableAddress[#return] :
# 2915| v2915_7(void) = ReturnValue : &:r2915_6, ~m?
# 2915| v2915_8(void) = AliasedUse : ~m?
# 2915| v2915_9(void) = ExitFunction :
# 2919| int VariableTemplateFuncUse
# 2919| Block 0
# 2919| v2919_1(void) = EnterFunction :
# 2919| mu2919_2(unknown) = AliasedDefinition :
# 2919| r2919_3(glval<int>) = VariableAddress[VariableTemplateFuncUse] :
# 2919| r2919_4(glval<unknown>) = FunctionAddress[VariableTemplateFunc] :
# 2919| r2919_5(double) = Constant[2.299999999999999822] :
# 2919| r2919_6(double) = Call[VariableTemplateFunc] : func:r2919_4, 0:r2919_5
# 2919| mu2919_7(unknown) = ^CallSideEffect : ~m?
# 2919| r2919_8(int) = Convert : r2919_6
# 2919| mu2919_9(int) = Store[VariableTemplateFuncUse] : &:r2919_3, r2919_8
# 2919| v2919_10(void) = ReturnVoid :
# 2919| v2919_11(void) = AliasedUse : ~m?
# 2919| v2919_12(void) = ExitFunction :
ir23.cpp:
# 1| bool consteval_1()
# 1| Block 0

View File

@@ -6,6 +6,7 @@ missingOperandType
duplicateChiOperand
sideEffectWithoutPrimary
instructionWithoutSuccessor
| ir.cpp:2906:11:2906:13 | VariableAddress: temporary object | Instruction 'VariableAddress: temporary object' has no successors in function '$@'. | ir.cpp:2906:7:2906:7 | T StructInitFromTemplate<T>::t | T StructInitFromTemplate<T>::t |
ambiguousSuccessors
unexplainedLoop
unnecessaryPhiInstruction
@@ -29,5 +30,6 @@ fieldAddressOnNonPointer
thisArgumentIsNonPointer
| ir.cpp:2548:34:2548:34 | Call: call to operator bool | Call instruction 'Call: call to operator bool' has a `this` argument operand that is not an address, in function '$@'. | ir.cpp:2547:6:2547:23 | void this_inconsistency(bool) | void this_inconsistency(bool) |
nonUniqueIRVariable
| ir.cpp:2906:11:2906:13 | VariableAddress: temporary object | Variable address instruction 'VariableAddress: temporary object' has no associated variable, in function '$@'. | ir.cpp:2906:7:2906:7 | T StructInitFromTemplate<T>::t | T StructInitFromTemplate<T>::t |
nonBooleanOperand
missingCppType

View File

@@ -6,6 +6,7 @@ missingOperandType
duplicateChiOperand
sideEffectWithoutPrimary
instructionWithoutSuccessor
| ir.cpp:2906:11:2906:13 | VariableAddress: temporary object | Instruction 'VariableAddress: temporary object' has no successors in function '$@'. | ir.cpp:2906:7:2906:7 | T StructInitFromTemplate<T>::t | T StructInitFromTemplate<T>::t |
ambiguousSuccessors
unexplainedLoop
unnecessaryPhiInstruction
@@ -29,5 +30,6 @@ fieldAddressOnNonPointer
thisArgumentIsNonPointer
| ir.cpp:2548:34:2548:34 | Call: call to operator bool | Call instruction 'Call: call to operator bool' has a `this` argument operand that is not an address, in function '$@'. | ir.cpp:2547:6:2547:23 | void this_inconsistency(bool) | void this_inconsistency(bool) |
nonUniqueIRVariable
| ir.cpp:2906:11:2906:13 | VariableAddress: temporary object | Variable address instruction 'VariableAddress: temporary object' has no associated variable, in function '$@'. | ir.cpp:2906:7:2906:7 | T StructInitFromTemplate<T>::t | T StructInitFromTemplate<T>::t |
nonBooleanOperand
missingCppType