<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/62362>62362</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Clang] ICE at clang::Expr::EvaluateAsConstantExpr()
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          alimpfard
      </td>
    </tr>
</table>

<pre>
    ```
clang: ../../clang/lib/AST/ExprConstant.cpp:15331: bool clang::Expr::EvaluateAsConstantExpr(clang::Expr::EvalResult &, const clang::ASTContext &, clang::Expr::ConstantExprKind) const: Assertion `!isValueDependent() && "Expression evaluator can't be called on a dependent expression."' failed.
```

<details>
<summary>ICE Error Output</summary>

```
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /home/test/Documents/oss/llvm-project/out/gn/bin/clang -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -main-file-name hpack.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/tmp -resource-dir /home/test/Documents/oss/llvm-project/out/gn/lib/clang/17 -internal-isystem /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1 -internal-isystem /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/x86_64-pc-linux-gnu -internal-isystem /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include/c++/12.2.1/backward -internal-isystem /home/test/Documents/oss/llvm-project/out/gn/lib/clang/17/include -internal-isystem /usr/local/include -internal-isystem /usr/lib64/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../x86_64-pc-linux-gnu/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++20 -fdeprecated-macro -fdebug-compilation-dir=/tmp -ferror-limit 19 -fgnuc-version=4.2.1 -fno-implicit-modules -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/hpack-1654b4.o -x c++ hpack.cpp
1.      hpack.cpp:17:17: current parser token ';'
2.      hpack.cpp:16:12: parsing function body 'foo'
3.      hpack.cpp:16:12: in compound statement ('{}')
 #0 0x000055c8c16a6992 PrintStackTraceSignalHandler(void*) (.llvm.15242681962188963970) Signals.cpp:0:0
 #1 0x000055c8c16a43d0 llvm::sys::RunSignalHandlers() (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x3a673d0)
 #2 0x000055c8c16a6d3d SignalHandler(int) Signals.cpp:0:0
 #3 0x00007fcd7fd69f50 (/usr/lib/libc.so.6+0x38f50)
 #4 0x00007fcd7fdb88ec (/usr/lib/libc.so.6+0x878ec)
 #5 0x00007fcd7fd69ea8 raise (/usr/lib/libc.so.6+0x38ea8)
 #6 0x00007fcd7fd5353d abort (/usr/lib/libc.so.6+0x2253d)
 #7 0x00007fcd7fd5345c (/usr/lib/libc.so.6+0x2245c)
 #8 0x00007fcd7fd629f6 (/usr/lib/libc.so.6+0x319f6)
 #9 0x000055c8c1f7ec6f clang::Expr::EvaluateAsConstantExpr(clang::Expr::EvalResult&, clang::ASTContext const&, clang::Expr::ConstantExprKind) const (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x4341c6f)
#10 0x000055c8c295748e clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7&&) SemaConcept.cpp:0:0
#11 0x000055c8c295072e CheckConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) SemaConcept.cpp:0:0
#12 0x000055c8c295024b clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x4d1324b)
#13 0x000055c8c29524af clang::Sema::CheckFunctionConstraints(clang::FunctionDecl const*, clang::ConstraintSatisfaction&, clang::SourceLocation, bool) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x4d154af)
#14 0x000055c8c2be68f7 clang::Sema::DiagnoseUseOfDecl(clang::NamedDecl*, llvm::ArrayRef<clang::SourceLocation>, clang::ObjCInterfaceDecl const*, bool, bool, clang::ObjCInterfaceDecl*, bool) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x4fa98f7)
#15 0x000055c8c2e874c2 PerformConstructorInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::InitializationSequence::Step const&, bool&, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
#16 0x000055c8c2e801ef clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x52431ef)
#17 0x000055c8c2d849c6 clang::Sema::BuildCXXTypeConstructExpr(clang::TypeSourceInfo*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, bool) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x51479c6)
#18 0x000055c8c2d83def clang::Sema::ActOnCXXTypeConstructExpr(clang::OpaquePtr<clang::QualType>, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, bool) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x5146def)
#19 0x000055c8c260463c clang::Parser::ParseCXXTypeConstructExpression(clang::DeclSpec const&) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x49c763c)
#20 0x000055c8c25aa9be clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x496d9be)
#21 0x000055c8c25a3bf4 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x4966bf4)
#22 0x000055c8c2639317 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) ParseStmt.cpp:0:0
#23 0x000055c8c2638962 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x49fb962)
#24 0x000055c8c26440c3 clang::Parser::ParseCompoundStatementBody(bool) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x4a070c3)
#25 0x000055c8c2644fd0 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x4a07fd0)
#26 0x000055c8c2584332 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x4947332)
#27 0x000055c8c25d7f43 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x499af43)
#28 0x000055c8c2581d9d clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x4944d9d)
#29 0x000055c8c258157c clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x494457c)
#30 0x000055c8c2580274 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x4943274)
#31 0x000055c8c257e132 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x4941132)
#32 0x000055c8c2578afe clang::ParseAST(clang::Sema&, bool, bool) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x493bafe)
#33 0x000055c8c0a331e5 clang::CodeGenAction::ExecuteAction() (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x2df61e5)
#34 0x000055c8c09474dd clang::FrontendAction::Execute() (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x2d0a4dd)
#35 0x000055c8c089c30f clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x2c5f30f)
#36 0x000055c8c0a2e5dc clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x2df15dc)
#37 0x000055c8bff75825 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x2338825)
#38 0x000055c8bff898ad ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#39 0x000055c8bff87d4f clang_main(int, char**, llvm::ToolContext const&) (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x234ad4f)
#40 0x000055c8bff8bb32 main (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x234eb32)
#41 0x00007fcd7fd54790 (/usr/lib/libc.so.6+0x23790)
#42 0x00007fcd7fd5484a __libc_start_main (/usr/lib/libc.so.6+0x2384a)
#43 0x000055c8bff74a85 _start (/home/test/Documents/oss/llvm-project/out/gn/bin/clang+0x2337a85)
clang++: error: unable to execute command: Aborted (core dumped)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 17.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/test//Documents/oss/llvm-project/out/gn/bin
```

</details>

Triggered by:
```c++
template <typename T, typename U> inline constexpr bool IsSame = false;
template <typename T> inline constexpr bool IsSame<T, T> = true;

struct Empty {};

template <typename T> struct Test {
 Test()
    requires(IsSame<T, Empty>);
};

template <>
struct Test<void> : public Test<Empty> {
  using Test<Empty>::Test;
};

void foo() {
 Test<void>();
}
```

(while reducing code for #62361, might be related)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkW19z4ziO_zTKC0suidTfhzw4djybuu7rvk52bt9SFAk5nJZEDUWlk_v0V6Tk2JT_ZXri2dvbqrTblggQ-AEEAQqiXSfWDcC1F9948fKK9vpJqmtaibotqeJXheSv114SjH_B0gvmrKLN2iNzNJt5eGU_hkt4VYnCw6v5_YOHV7cvrVrIptO00TPWth6ZhzEhoaEspKzQho9H5mbs-O2ZVj3VMO82tPYezo6O_gZdX2nk4cTDC8QM1S7r-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