diff --git a/clang/lib/AST/Interp/ByteCodeStmtGen.cpp b/clang/lib/AST/Interp/ByteCodeStmtGen.cpp index 6faa3f9a47a9b..2c53900111d9b 100644 --- a/clang/lib/AST/Interp/ByteCodeStmtGen.cpp +++ b/clang/lib/AST/Interp/ByteCodeStmtGen.cpp @@ -224,7 +224,7 @@ bool ByteCodeStmtGen::visitCompoundStmt( template bool ByteCodeStmtGen::visitDeclStmt(const DeclStmt *DS) { for (auto *D : DS->decls()) { - if (isa(D)) + if (isa(D)) continue; const auto *VD = dyn_cast(D); diff --git a/clang/test/AST/Interp/literals.cpp b/clang/test/AST/Interp/literals.cpp index 5883c1879b925..f31a49088dc6c 100644 --- a/clang/test/AST/Interp/literals.cpp +++ b/clang/test/AST/Interp/literals.cpp @@ -766,3 +766,16 @@ namespace TypeTraits { static_assert(S3{}.foo(), ""); static_assert(!S3{}.foo(), ""); } + +#if __cplusplus >= 201402L +constexpr int ignoredDecls() { + static_assert(true, ""); + struct F { int a; }; + enum E { b }; + using A = int; + typedef int Z; + + return F{12}.a; +} +static_assert(ignoredDecls() == 12, ""); +#endif