From ecb7e5c8afe929ee38155db94de6b084ec32a645 Mon Sep 17 00:00:00 2001 From: Roman Divacky Date: Tue, 16 Feb 2010 09:31:36 +0000 Subject: Update clang to r96341. --- test/CXX/basic/basic.def.odr/p1-var.cpp | 21 +++++++++++++++++++++ .../basic.lookup/basic.lookup.elab/templateid.cpp | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 test/CXX/basic/basic.def.odr/p1-var.cpp (limited to 'test/CXX/basic') diff --git a/test/CXX/basic/basic.def.odr/p1-var.cpp b/test/CXX/basic/basic.def.odr/p1-var.cpp new file mode 100644 index 0000000000000..892f546ee5451 --- /dev/null +++ b/test/CXX/basic/basic.def.odr/p1-var.cpp @@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +// C++ [basic.def.odr]p1: +// No translation unit shall contain more than one definition of any +// variable, [...]. + +// Bad: in C++, these are both definitions. None of that C99 tentative stuff. +int i; // expected-note {{previous}} +int i; // expected-error {{redefinition}} + +// OK: decl + def +extern int j; +int j; + +// OK: def + decl +int k; +extern int k; + +// Bad. The important thing here is that we don't emit the diagnostic twice. +int l = 1; // expected-note {{previous}} +int l = 2; // expected-error {{redefinition}} diff --git a/test/CXX/basic/basic.lookup/basic.lookup.elab/templateid.cpp b/test/CXX/basic/basic.lookup/basic.lookup.elab/templateid.cpp index 76b6e2b574652..8126d28562ae7 100644 --- a/test/CXX/basic/basic.lookup/basic.lookup.elab/templateid.cpp +++ b/test/CXX/basic/basic.lookup/basic.lookup.elab/templateid.cpp @@ -15,4 +15,4 @@ namespace A { } class Ident GlobalIdent; -union Ident GlobalIdent; // expected-error {{ tag type that does not match }} +union Ident GlobalIdent2; // expected-error {{ tag type that does not match }} -- cgit v1.3