diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index 1762148dbc566c007d82214cf64a7f7b0f0cf85a..89612b9c93a95843cdea5c98fa18d407a67b445c 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -1932,7 +1932,7 @@ enum CXCursorKind { */ CXCursor_CXXDeleteExpr = 135, - /** \brief A unary expression. + /** \brief A unary expression. (noexcept, sizeof, or other traits) */ CXCursor_UnaryExpr = 136, diff --git a/test/Index/annotate-tokens.c b/test/Index/annotate-tokens.c index 2f95ca6f458c918ab23e314db4e8c367158ddeea..c72e4f725fcce9b614f4b7b493eb1b756f8e1e3d 100644 --- a/test/Index/annotate-tokens.c +++ b/test/Index/annotate-tokens.c @@ -80,10 +80,10 @@ void test() { // CHECK: Punctuation: "(" [5:3 - 5:4] CStyleCastExpr= // CHECK: Keyword: "void" [5:4 - 5:8] CStyleCastExpr= // CHECK: Punctuation: ")" [5:8 - 5:9] CStyleCastExpr= -// CHECK: Keyword: "sizeof" [5:9 - 5:15] UnexposedExpr= -// CHECK: Punctuation: "(" [5:15 - 5:16] UnexposedExpr= +// CHECK: Keyword: "sizeof" [5:9 - 5:15] UnaryExpr= +// CHECK: Punctuation: "(" [5:15 - 5:16] UnaryExpr= // CHECK: Identifier: "T" [5:16 - 5:17] TypeRef=T:1:13 -// CHECK: Punctuation: ")" [5:17 - 5:18] UnexposedExpr= +// CHECK: Punctuation: ")" [5:17 - 5:18] UnaryExpr= // CHECK: Punctuation: ";" [5:18 - 5:19] CompoundStmt= // CHECK: Keyword: "struct" [7:3 - 7:9] VarDecl=x:7:12 (Definition) // CHECK: Identifier: "X" [7:10 - 7:11] TypeRef=struct X:2:8 diff --git a/tools/libclang/CXCursor.cpp b/tools/libclang/CXCursor.cpp index 25581a8d3f68ba49c0fc3de3d0fd61a7ab427351..075ff291d13acf1104f79e7e225080d4b739d822 100644 --- a/tools/libclang/CXCursor.cpp +++ b/tools/libclang/CXCursor.cpp @@ -256,7 +256,6 @@ CXCursor cxcursor::MakeCXCursor(const Stmt *S, const Decl *Parent, case Stmt::PredefinedExprClass: case Stmt::ShuffleVectorExprClass: case Stmt::ConvertVectorExprClass: - case Stmt::UnaryExprOrTypeTraitExprClass: case Stmt::VAArgExprClass: case Stmt::ObjCArrayLiteralClass: case Stmt::ObjCDictionaryLiteralClass: @@ -327,6 +326,7 @@ CXCursor cxcursor::MakeCXCursor(const Stmt *S, const Decl *Parent, K = CXCursor_UnaryOperator; break; + case Stmt::UnaryExprOrTypeTraitExprClass: case Stmt::CXXNoexceptExprClass: K = CXCursor_UnaryExpr; break;