-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the warnings for extra semi-colons under -Wextra-semi. Also, added
a warning for an extra semi-colon after function definitions. Added logic so that a block of semi-colons on a line will only get one warning instead of a warning for each semi-colon. llvm-svn: 156934
- Loading branch information
1 parent
8c17fbd
commit 2f7dc46
Showing
9 changed files
with
83 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// RUN: %clang_cc1 -fsyntax-only -Wextra-semi -verify %s | ||
// RUN: cp %s %t | ||
// RUN: %clang_cc1 -x c++ -Wextra-semi -fixit %t | ||
// RUN: %clang_cc1 -x c++ -Wextra-semi -Werror %t | ||
|
||
class A { | ||
void A1(); | ||
void A2() { }; // expected-warning{{extra ';' after function definition}} | ||
; // expected-warning{{extra ';' inside a class}} | ||
void A3() { }; ;; // expected-warning{{extra ';' after function definition}} | ||
;;;;;;; // expected-warning{{extra ';' inside a class}} | ||
; // expected-warning{{extra ';' inside a class}} | ||
; ;; ; ;;; // expected-warning{{extra ';' inside a class}} | ||
; ; ; ; ;; // expected-warning{{extra ';' inside a class}} | ||
void A4(); | ||
}; | ||
|
||
union B { | ||
int a1; | ||
int a2;; // expected-warning{{extra ';' inside a union}} | ||
}; | ||
|
||
; // expected-warning{{extra ';' outside of a function}} | ||
; ;;// expected-warning{{extra ';' outside of a function}} | ||
|