Skip to content

Commit 00bdce1

Browse files
authored
[clang][bytecode] Ignore Namespace{Using,Alias}Decls (llvm#125387)
These were missing here and are used in a few libc++ tests.
1 parent caeefe7 commit 00bdce1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4991,8 +4991,8 @@ bool Compiler<Emitter>::visitCompoundStmt(const CompoundStmt *S) {
49914991
template <class Emitter>
49924992
bool Compiler<Emitter>::visitDeclStmt(const DeclStmt *DS) {
49934993
for (const auto *D : DS->decls()) {
4994-
if (isa<StaticAssertDecl, TagDecl, TypedefNameDecl, UsingEnumDecl,
4995-
FunctionDecl>(D))
4994+
if (isa<StaticAssertDecl, TagDecl, TypedefNameDecl, BaseUsingDecl,
4995+
FunctionDecl, NamespaceAliasDecl>(D))
49964996
continue;
49974997

49984998
const auto *VD = dyn_cast<VarDecl>(D);

clang/test/AST/ByteCode/literals.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,12 +914,18 @@ namespace TypeTraits {
914914
}
915915

916916
#if __cplusplus >= 201402L
917+
namespace SomeNS {
918+
using MyInt = int;
919+
}
920+
917921
constexpr int ignoredDecls() {
918922
static_assert(true, "");
919923
struct F { int a; };
920924
enum E { b };
921925
using A = int;
922926
typedef int Z;
927+
namespace NewNS = SomeNS;
928+
using NewNS::MyInt;
923929

924930
return F{12}.a;
925931
}

0 commit comments

Comments
 (0)