-
Notifications
You must be signed in to change notification settings - Fork 54
Бессонов Егор. Лабораторная работа 1. Clang AST. Вариант 2 #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: course-spring-2025
Are you sure you want to change the base?
Бессонов Егор. Лабораторная работа 1. Clang AST. Вариант 2 #68
Conversation
@@ -0,0 +1,28 @@ | |||
// RUN: %clang_cc1 -load %llvmshlibdir/first_lab_Bessonov_Egor_FIIT2_ClangAST%pluginext -plugin bessonov_e_unused_var_plugin -fsyntax-only %s 2>&1 | FileCheck %s | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, add the test for the variable that already has such attribute
// CHECK: int foo(int a, int b, \[\[maybe_unused\]\] int c) { | ||
// CHECK: \[\[maybe_unused\]\] double temp = 0.0; | ||
// CHECK: return a + b; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// CHECK: int foo(int a, int b, \[\[maybe_unused\]\] int c) { | |
// CHECK: \[\[maybe_unused\]\] double temp = 0.0; | |
// CHECK: return a + b; | |
// CHECK-LABEL: int foo(int a, int b, \[\[maybe_unused\]\] int c) { | |
// CHECK-NEXT: \[\[maybe_unused\]\] double temp = 0.0; | |
// CHECK-NEXT: return a + b; |
Also in other tests
void process(int p, int q, int r) { | ||
int local = p + r; | ||
int used = p * r; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test with already present __attribute__((unused))
плагин для Clang, который автоматически добавляет атрибут [[maybe_unused]] к неиспользуемым переменным и параметрам