[cfe-commits] r166616 - in /cfe/trunk/test: Sema/warn-missing-variable-declarations.cpp SemaCXX/warn-missing-variable-declarations.cpp

Eli Friedman eli.friedman at gmail.com
Wed Oct 24 13:14:09 PDT 2012


Author: efriedma
Date: Wed Oct 24 15:14:09 2012
New Revision: 166616

URL: http://llvm.org/viewvc/llvm-project?rev=166616&view=rev
Log:
Add an additional test for namespaces and -Wmissing-variable-declarations.  Move C++ test into SemaCXX.


Added:
    cfe/trunk/test/SemaCXX/warn-missing-variable-declarations.cpp
      - copied, changed from r166504, cfe/trunk/test/Sema/warn-missing-variable-declarations.cpp
Removed:
    cfe/trunk/test/Sema/warn-missing-variable-declarations.cpp

Removed: cfe/trunk/test/Sema/warn-missing-variable-declarations.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-missing-variable-declarations.cpp?rev=166615&view=auto
==============================================================================
--- cfe/trunk/test/Sema/warn-missing-variable-declarations.cpp (original)
+++ cfe/trunk/test/Sema/warn-missing-variable-declarations.cpp (removed)
@@ -1,39 +0,0 @@
-// RUN: %clang -Wmissing-variable-declarations -fsyntax-only -Xclang -verify %s
-
-// Variable declarations that should trigger a warning.
-int vbad1; // expected-warning{{no previous extern declaration for non-static variable 'vbad1'}}
-int vbad2 = 10; // expected-warning{{no previous extern declaration for non-static variable 'vbad2'}}
-
-// Variable declarations that should not trigger a warning.
-static int vgood1;
-extern int vgood2;
-int vgood2;
-static struct {
-  int mgood1;
-} vgood3;
-
-// Functions should never trigger a warning.
-void fgood1(void);
-void fgood2(void) {
-  int lgood1;
-  static int lgood2;
-}
-static void fgood3(void) {
-  int lgood3;
-  static int lgood4;
-}
-
-// Structures, namespaces and classes should be unaffected.
-struct sgood1 {
-  int mgood2;
-};
-struct {
-  int mgood3;
-} sgood2;
-class CGood1 {
-  static int MGood1;
-};
-int CGood1::MGood1;
-namespace {
-  int mgood4;
-}

Copied: cfe/trunk/test/SemaCXX/warn-missing-variable-declarations.cpp (from r166504, cfe/trunk/test/Sema/warn-missing-variable-declarations.cpp)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-missing-variable-declarations.cpp?p2=cfe/trunk/test/SemaCXX/warn-missing-variable-declarations.cpp&p1=cfe/trunk/test/Sema/warn-missing-variable-declarations.cpp&r1=166504&r2=166616&rev=166616&view=diff
==============================================================================
--- cfe/trunk/test/Sema/warn-missing-variable-declarations.cpp (original)
+++ cfe/trunk/test/SemaCXX/warn-missing-variable-declarations.cpp Wed Oct 24 15:14:09 2012
@@ -4,6 +4,10 @@
 int vbad1; // expected-warning{{no previous extern declaration for non-static variable 'vbad1'}}
 int vbad2 = 10; // expected-warning{{no previous extern declaration for non-static variable 'vbad2'}}
 
+namespace x {
+  int vbad3; // expected-warning{{no previous extern declaration for non-static variable 'vbad3'}}
+}
+
 // Variable declarations that should not trigger a warning.
 static int vgood1;
 extern int vgood2;





More information about the cfe-commits mailing list