diff --git a/docs/ReleaseNotes.html b/docs/ReleaseNotes.html index 8a195f0b83e..a1ba15ce1cc 100644 --- a/docs/ReleaseNotes.html +++ b/docs/ReleaseNotes.html @@ -43,12 +43,6 @@ td {

Written by the LLVM Team

-

These are in-progress notes for the upcoming Clang 3.2 -release.
-You may prefer the -Clang 3.1 -Release Notes.

-

Introduction

@@ -91,7 +85,7 @@ explain them more clearly, and provide more accurate source information about them. The improvements since the 3.1 release include:

@@ -215,6 +206,35 @@ function call.

pointer_with_type_tag and type_tag_for_datatype attributes in Clang language extensions documentation.

+

Documentation comment support

+

Clang now supports documentation comments written in a Doxygen-like syntax. +Clang parses the comments and can detect syntactic and semantic errors in +comments. These warnings are off by default. Pass -Wdocumentation +flag to enable warnings about documentation comments.

+ +

For example, given:

+ +
/// \param [in] Str the string.
+/// \returns a modified string.
+void do_something(const std::string &str);
+ +

clang -Wdocumentation will emit two warnings:

+ +
doc-test.cc:3:6: warning: '\returns' command used in a comment that is attached to a function returning void [-Wdocumentation]
+/// \returns a modified string.
+    ~^~~~~~~~~~~~~~~~~~~~~~~~~~
+doc-test.cc:2:17: warning: parameter 'Str' not found in the function declaration [-Wdocumentation]
+/// \param [in] Str the string.
+                ^~~
+doc-test.cc:2:17: note: did you mean 'str'?
+/// \param [in] Str the string.
+                ^~~
+                str
+ +

libclang includes a new API, clang_FullComment_getAsXML, to convert +comments to XML documents. This API can be used to build documentation +extraction tools.

+

New Compiler Flags

@@ -239,7 +259,8 @@ attributes in Clang language extensions documentation.

C11 Feature Support

-

...

+

Clang 3.2 adds support for the C11 _Alignof keyword, pedantic warning through option + -Wempty-translation-unit (C11 6.9p1)

C++ Language Changes in Clang

@@ -247,39 +268,41 @@ attributes in Clang language extensions documentation.

C++11 Feature Support

-

...

+

Clang 3.2 supports most of the language features + added in the latest ISO C++ standard,C++ 2011. + Use -std=c++11 or -std=gnu++11 to enable support for these features. In addition to the features supported by Clang 3.1, the + following features have been added:

+ +

Objective-C Language Changes in Clang

-

...

- - -

Internal API Changes

- - -

These are major API changes that have happened since the 3.1 release of - Clang. If upgrading an external codebase that uses Clang as a library, this - section should help get you past the largest hurdles of upgrading.

- -

API change 1

- -

...

+

Bug-fixes, no functionality changes.

Python Binding Changes

-The following methods have been added: +The following classes and methods have been added: - -

Significant Known Problems

- -

Additional Information

@@ -296,17 +319,6 @@ The following methods have been added: the mailing list.

- - - - diff --git a/include/clang/Sema/Scope.h b/include/clang/Sema/Scope.h index fa508cfc22d..1329f97c2bc 100644 --- a/include/clang/Sema/Scope.h +++ b/include/clang/Sema/Scope.h @@ -84,11 +84,18 @@ public: /// TryScope - This is the scope of a C++ try statement. TryScope = 0x1000, + /// CatchScope - This is the scope of a C++ catch statement. + CatchScope = 0x2000, + + /// FnTryCatchScope - This is the scope for a function-level C++ try or + /// catch scope. + FnTryCatchScope = 0x4000, + /// FnTryScope - This is the scope of a function-level C++ try scope. - FnTryScope = 0x3000, + FnTryScope = TryScope | FnTryCatchScope, /// FnCatchScope - This is the scope of a function-level C++ catch scope. - FnCatchScope = 0x4000 + FnCatchScope = CatchScope | FnTryCatchScope }; private: /// The parent scope for this scope. This is null for the translation-unit diff --git a/lib/Basic/Version.cpp b/lib/Basic/Version.cpp index 286e96e0f37..dc7d8d14eef 100644 --- a/lib/Basic/Version.cpp +++ b/lib/Basic/Version.cpp @@ -32,7 +32,7 @@ std::string getClangRepositoryPath() { // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - static StringRef SVNRepository("$URL: http://llvm.org/svn/llvm-project/cfe/branches/release_32/lib/Basic/Version.cpp $"); + static StringRef SVNRepository("$URL: http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_32/final/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index a2ccb35ed26..7d70cd50de3 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -1855,6 +1855,8 @@ enum LinuxDistro { UbuntuNatty, UbuntuOneiric, UbuntuPrecise, + UbuntuQuantal, + UbuntuRaring, UnknownDistro }; @@ -1872,7 +1874,7 @@ static bool IsDebian(enum LinuxDistro Distro) { } static bool IsUbuntu(enum LinuxDistro Distro) { - return Distro >= UbuntuHardy && Distro <= UbuntuPrecise; + return Distro >= UbuntuHardy && Distro <= UbuntuRaring; } static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) { @@ -1894,6 +1896,8 @@ static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) { .Case("natty", UbuntuNatty) .Case("oneiric", UbuntuOneiric) .Case("precise", UbuntuPrecise) + .Case("quantal", UbuntuQuantal) + .Case("raring", UbuntuRaring) .Default(UnknownDistro); return Version; } diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index 4cb14e24f48..f11a9d19957 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -706,8 +706,7 @@ SourceLocation Parser::ParseDecltypeSpecifier(DeclSpec &DS) { if (SkipUntil(tok::r_paren, /*StopAtSemi=*/true, /*DontConsume=*/true)) { EndLoc = ConsumeParen(); } else { - assert(Tok.is(tok::semi)); - if (PP.isBacktrackEnabled()) { + if (PP.isBacktrackEnabled() && Tok.is(tok::semi)) { // Backtrack to get the location of the last token before the semi. PP.RevertCachedTokens(2); ConsumeToken(); // the semi. diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index f604e038d2a..58831158502 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -2197,7 +2197,7 @@ StmtResult Parser::ParseCXXCatchBlock(bool FnCatch) { // The name in a catch exception-declaration is local to the handler and // shall not be redeclared in the outermost block of the handler. ParseScope CatchScope(this, Scope::DeclScope | Scope::ControlScope | - (FnCatch ? Scope::FnCatchScope : 0)); + (FnCatch ? Scope::FnCatchScope : Scope::CatchScope)); // exception-declaration is equivalent to '...' or a parameter-declaration // without default arguments. diff --git a/lib/Sema/IdentifierResolver.cpp b/lib/Sema/IdentifierResolver.cpp index 00939151c67..7d5530442f4 100644 --- a/lib/Sema/IdentifierResolver.cpp +++ b/lib/Sema/IdentifierResolver.cpp @@ -135,16 +135,13 @@ bool IdentifierResolver::isDeclInScope(Decl *D, DeclContext *Ctx, // of the controlled statement. // assert(S->getParent() && "No TUScope?"); - if (S->getFlags() & Scope::FnTryScope) - return S->getParent()->isDeclScope(D); if (S->getParent()->getFlags() & Scope::ControlScope) { - if (S->getParent()->getFlags() & Scope::FnCatchScope) { - S = S->getParent(); - if (S->isDeclScope(D)) - return true; - } - return S->getParent()->isDeclScope(D); + S = S->getParent(); + if (S->isDeclScope(D)) + return true; } + if (S->getFlags() & Scope::FnTryCatchScope) + return S->getParent()->isDeclScope(D); } return false; } diff --git a/test/CXX/basic/basic.scope/basic.scope.local/p2.cpp b/test/CXX/basic/basic.scope/basic.scope.local/p2.cpp index 91e96b6b262..7c7b84d6782 100644 --- a/test/CXX/basic/basic.scope/basic.scope.local/p2.cpp +++ b/test/CXX/basic/basic.scope/basic.scope.local/p2.cpp @@ -35,3 +35,26 @@ void func7() { int i; // expected-error{{redefinition of 'i'}} } } + +void func8() { + int i; + try { + int i; + } catch (...) { + } +} + +void func9() { + if (bool b = true) + try { + int b; // FIXME: this probably should be invalid, maybe + } catch (...) { + } +} + +void func10() { + if (bool b = true) + if (true) { + int b; // FIXME: decide whether this is valid + } +} diff --git a/test/Parser/bracket-crash.cpp b/test/Parser/bracket-crash.cpp index bcc6eabc6e9..93b52940773 100644 --- a/test/Parser/bracket-crash.cpp +++ b/test/Parser/bracket-crash.cpp @@ -4,3 +4,6 @@ decltype(; struct{ a } + +// PR14549. Must be at end of file. +decltype(