]> granicus.if.org Git - clang/log
clang
10 years agoThis test also requires an aarch64 target.
Eric Christopher [Tue, 18 Nov 2014 22:36:11 +0000 (22:36 +0000)]
This test also requires an aarch64 target.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222268 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Sema] Patch to issue warning on comparing parameters with
Fariborz Jahanian [Tue, 18 Nov 2014 21:57:54 +0000 (21:57 +0000)]
[Sema] Patch to issue warning on comparing parameters with
nonnull attribute when comparison is always true/false.
Original patch by Steven Wu. I have added extra code to prevent issuing of
warning  when the nonnull parameter is modified prior to the comparison.
This addition prevents false positives in the most obvious cases.
There may still be false positive warnings in some cases (as one of my tests
indicates), but benefit far outweighs such cases. rdar://18712242

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222264 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoOMPAtomicDirective::Create(): Fix \param. [-Wdocumentation]
NAKAMURA Takumi [Tue, 18 Nov 2014 15:05:01 +0000 (15:05 +0000)]
OMPAtomicDirective::Create(): Fix \param. [-Wdocumentation]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222237 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[OPENMP] Additional processing of 'omp atomic read' directive.
Alexey Bataev [Tue, 18 Nov 2014 10:14:22 +0000 (10:14 +0000)]
[OPENMP] Additional processing of 'omp atomic read' directive.
According to OpenMP standard, Section 2.12.6, atomic Construct, '#pragma omp atomic read' is allowed to be used only for expression statements of form 'v = x;', where x and v (as applicable) are both l-value expressions with scalar type. Patch adds checks for it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222231 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd PIC-level support to Clang.
Justin Hibbits [Tue, 18 Nov 2014 06:17:20 +0000 (06:17 +0000)]
Add PIC-level support to Clang.

Summary:
This distinguishes between -fpic and -fPIC now, with the additions in LLVM for
PIC level support.

Test Plan: No regressions

Reviewers: echristo, rafael

Reviewed By: rafael

Subscribers: rnk, emaste, llvm-commits

Differential Revision: http://reviews.llvm.org/D5400

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222227 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[ASTReader] Add a convenience function to retrieve all the input files of a module...
Argyrios Kyrtzidis [Tue, 18 Nov 2014 05:24:18 +0000 (05:24 +0000)]
[ASTReader] Add a convenience function to retrieve all the input files of a module file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222224 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFully handle globals and functions in CGDebugInfo::getDeclarationOrDefinition()
Frederic Riss [Tue, 18 Nov 2014 03:40:51 +0000 (03:40 +0000)]
Fully handle globals and functions in CGDebugInfo::getDeclarationOrDefinition()

Currently this function would return nothing for functions or globals that
haven't seen a definition yet. Make it return a forward declaration that will
get RAUWed with the definition if one is seen at a later point. The strategy
used to implement this is similar to what's done for types: the forward
declarations are stored in a vector and post processed upon finilization to
perform the required RAUWs.

For now the only user of getDeclarationOrDefinition() is EmitUsingDecl(), thus
this patch allows to emit correct imported declarations even in the absence of
an actual definition of the imported entity.

(Another user will be the debug info generation for argument default values
that I need to resurect).

Differential Revision: http://reviews.llvm.org/D6173

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222220 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[DebugInfo] Move collection of various function/var decl properties into helper funct...
Frederic Riss [Tue, 18 Nov 2014 03:40:46 +0000 (03:40 +0000)]
[DebugInfo] Move collection of various function/var decl properties into helper functions.

NFC. Helpers to be re-used in upcoming commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222219 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoInstrProf: Don't emit coverage for uninstantiated templates
Justin Bogner [Tue, 18 Nov 2014 00:34:46 +0000 (00:34 +0000)]
InstrProf: Don't emit coverage for uninstantiated templates

We include unused functions and methods in -fcoverage-mapping so that
we can differentiate between uninstrumented and unused. This can cause
problems for uninstantiated templates though, since they may involve
an incomplete type that can't be mangled. This shows up in things like
libc++'s <unordered_map> and makes coverage unusable.

Avoid the issue by skipping uninstantiated methods of a templated
class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222204 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDebug Info: context field of a global variable is DIScopeRef.
Manman Ren [Tue, 18 Nov 2014 00:29:32 +0000 (00:29 +0000)]
Debug Info: context field of a global variable is DIScopeRef.

Paired commit with r222195.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222196 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix an assertion when ending a function definition.
John McCall [Tue, 18 Nov 2014 00:19:01 +0000 (00:19 +0000)]
Fix an assertion when ending a function definition.

The bug is that ExprCleanupObjects isn't always empty
in a fresh evaluation context.  New evaluation contexts just
track the current depth of the stack.

The assertion will misfire whenever we finish processing
a function body inside an expression that contained an earlier
block literal with non-trivial captures.  That's actually
a lot less likely than you'd think, though, because it has
to be a real function declaration, not just another block.
Mixed block/lambda code would work, as would a template
instantiation or a local class definition.

The code works correctly if the assertion is disabled.

rdar://16356628

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222194 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMake DiagnosticsEngine::takeClient return std::unique_ptr<>
Alexander Kornienko [Mon, 17 Nov 2014 23:46:02 +0000 (23:46 +0000)]
Make DiagnosticsEngine::takeClient return std::unique_ptr<>

Summary:
Make DiagnosticsEngine::takeClient return std::unique_ptr<>. Updated
callers to store conditional ownership using a pair of pointer and unique_ptr
instead of a pointer + bool. Updated code that temporarily registers clients to
use the non-owning registration (+ removed extra calls to takeClient).

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D6294

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222193 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoHandle use of default member initializers before end of outermost class
Reid Kleckner [Mon, 17 Nov 2014 23:36:45 +0000 (23:36 +0000)]
Handle use of default member initializers before end of outermost class

Specifically, when we have this situation:
  struct A {
    template <typename T> struct B {
      int m1 = sizeof(A);
    };
    B<int> m2;
  };

We can't parse m1's initializer eagerly because we need A to be
complete.  Therefore we wait until the end of A's class scope to parse
it. However, we can trigger instantiation of B before the end of A,
which will attempt to instantiate the field decls eagerly, and it would
build a bad field decl instantiation that said it had an initializer but
actually lacked one.

Fixed by deferring instantiation of default member initializers until
they are needed during constructor analysis. This addresses a long
standing FIXME in the code.

Fixes PR19195.

Reviewed By: rsmith

Differential Revision: http://reviews.llvm.org/D5690

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222192 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCodeGen: make a check stricter
Saleem Abdulrasool [Mon, 17 Nov 2014 22:11:07 +0000 (22:11 +0000)]
CodeGen: make a check stricter

When targeting Windows itanium (a MSVC environment), use itanium style
exceptions rather than SEH.  Existing test cases already test this code path.
Applying this change ensures that tests wont break due to a parallel change in
LLVM (to correctly report isMSVCEnvironment).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222179 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMissing comma in a string array initialization (CID 1254893)
Sylvestre Ledru [Mon, 17 Nov 2014 19:41:49 +0000 (19:41 +0000)]
Missing comma in a string array initialization (CID 1254893)

Summary:
We have this error from a while (Wed Jun 15 18:02:42 2011
r133103)

Reviewers: rsmith

Reviewed By: rsmith

Differential Revision: http://reviews.llvm.org/D6296

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222169 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-cl: Allow /Fo without an argument (PR21589)
Hans Wennborg [Mon, 17 Nov 2014 19:16:36 +0000 (19:16 +0000)]
clang-cl: Allow /Fo without an argument (PR21589)

When it's used without an argument, the default file name is
used. The same goes for /Fe.

Also, allow using /Fo, /Fa and /Fe with multiple inputs if they
don't have an argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222164 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Fix more incorrect pointer detection.
Daniel Jasper [Mon, 17 Nov 2014 18:42:22 +0000 (18:42 +0000)]
clang-format: Fix more incorrect pointer detection.

Before:
  Constructor() : a(a), b(c, d *e) {}

After:
  Constructor() : a(a), b(c, d * e) {}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222158 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agotest/Driver/cl-outputs.c: tweak some check prefixes; NFC.
Hans Wennborg [Mon, 17 Nov 2014 18:40:45 +0000 (18:40 +0000)]
test/Driver/cl-outputs.c: tweak some check prefixes; NFC.

These tests deal with the /o option; rename to better reflect that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222157 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoBasic: tweak comment
Saleem Abdulrasool [Mon, 17 Nov 2014 18:40:15 +0000 (18:40 +0000)]
Basic: tweak comment

Add a missing surrounding brace for doxygen group.  This messes with pair
jumping in vim and is annoying.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222155 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix the indentation: Nesting level does not match indentation (CID 1254863)
Sylvestre Ledru [Mon, 17 Nov 2014 18:26:39 +0000 (18:26 +0000)]
Fix the indentation: Nesting level does not match indentation (CID 1254863)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222152 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFixing a use of stringstream to use an LLVM helper function. Drive-by fixing header...
Aaron Ballman [Mon, 17 Nov 2014 18:17:19 +0000 (18:17 +0000)]
Fixing a use of stringstream to use an LLVM helper function. Drive-by fixing header include order. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222151 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Reassociate] Update test cases due to r222142.
Chad Rosier [Mon, 17 Nov 2014 16:34:47 +0000 (16:34 +0000)]
[Reassociate] Update test cases due to r222142.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222144 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMinor readability tweaks to VFTableBuilder.cpp
Timur Iskhodzhanov [Mon, 17 Nov 2014 15:53:50 +0000 (15:53 +0000)]
Minor readability tweaks to VFTableBuilder.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222140 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd a couple more examples illustrating why we need vtordisps and how they work
Timur Iskhodzhanov [Mon, 17 Nov 2014 15:11:05 +0000 (15:11 +0000)]
Add a couple more examples illustrating why we need vtordisps and how they work

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222133 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove VariadicOperatorMatcherInterface as it is redundant with logic from DynTypedMa...
Samuel Benzaquen [Mon, 17 Nov 2014 14:55:49 +0000 (14:55 +0000)]
Remove VariadicOperatorMatcherInterface as it is redundant with logic from DynTypedMatcher.

Summary:
The generic variadic matcher is faster (one less virtual function call
per match) and doesn't require template instantiations which reduces
compile time and binary size.
Registry.cpp.o generates ~14% less symbols and compiles ~7.5% faster.
The change also speeds up our clang-tidy benchmark by ~2%.

Reviewers: klimek

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D6278

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222131 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoA small correction for r221884. No functional changes.
Alexander Kornienko [Mon, 17 Nov 2014 14:46:28 +0000 (14:46 +0000)]
A small correction for r221884. No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222130 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Fix regression introduced in r221609.
Daniel Jasper [Mon, 17 Nov 2014 13:55:04 +0000 (13:55 +0000)]
clang-format: Fix regression introduced in r221609.

Before:
  void f() { f(a, c *d); }

After:
  void f() { f(a, c * d); }

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222128 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Sanitizer] Parse and produce all sanitizer-relevant arguments in SanitizerArgs.
Alexey Samsonov [Sun, 16 Nov 2014 20:53:53 +0000 (20:53 +0000)]
[Sanitizer] Parse and produce all sanitizer-relevant arguments in SanitizerArgs.

In particular, make SanitizerArgs responsible for parsing
and passing down to frontend -fsanitize-recover and
-fsanitize-undefined-trap-on-error flags.

Simplify parsing -f(no-)sanitize= flags parsing: get rid of
too complex filterUnsupportedKinds function.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222105 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix issues missed during the review of r222099.
Richard Trieu [Sat, 15 Nov 2014 06:37:39 +0000 (06:37 +0000)]
Fix issues missed during the review of r222099.

Shift some functions around, make a method in Sema private,
call the correct overloaded function.  No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222081 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix IRGen for passing transparent unions
Reid Kleckner [Sat, 15 Nov 2014 01:41:41 +0000 (01:41 +0000)]
Fix IRGen for passing transparent unions

We have had a test for this for a long time with a FIXME saying what we
should be doing. This just does it.

Fixes PR21573.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222074 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCGDebugInfo: Update for DIBuilder API change
Duncan P. N. Exon Smith [Sat, 15 Nov 2014 00:24:50 +0000 (00:24 +0000)]
CGDebugInfo: Update for DIBuilder API change

Tracking LLVM commit r222070.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222071 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThis patch fixes couple of bugs for predefined expression
Fariborz Jahanian [Fri, 14 Nov 2014 23:55:27 +0000 (23:55 +0000)]
This patch fixes couple of bugs for predefined expression
used inside blocks. It fixes a crash in naming code
for __func__ etc. when used in a block declared globally.
It also brings back old naming convention for
predefined expression which was broken. rdar://18961148

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222065 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[c++1z] Support [[deprecated]] attributes on namespaces. Note that it only applies...
Aaron Ballman [Fri, 14 Nov 2014 22:34:56 +0000 (22:34 +0000)]
[c++1z] Support [[deprecated]] attributes on namespaces. Note that it only applies to situations where the namespace is mentioned. Thus, use on anonymous namespaces is diagnosed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222054 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRecommit r222044 with a test fix - it does not make sense to hunt
Anton Korobeynikov [Fri, 14 Nov 2014 22:09:15 +0000 (22:09 +0000)]
Recommit r222044 with a test fix - it does not make sense to hunt
for a typedef before arithmetic conversion in all rare corner cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222049 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemoving an unused variable; NFC.
Aaron Ballman [Fri, 14 Nov 2014 21:57:30 +0000 (21:57 +0000)]
Removing an unused variable; NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222048 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAgain revert r222044 to resolve darwin objc test fails.
Anton Korobeynikov [Fri, 14 Nov 2014 21:54:46 +0000 (21:54 +0000)]
Again revert r222044 to resolve darwin objc test fails.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222047 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFollow-up to D6217
Anton Korobeynikov [Fri, 14 Nov 2014 21:41:07 +0000 (21:41 +0000)]
Follow-up to D6217

Summary:
Ok, here is somewhat addition to D6217 aiming to preserve old darwin behavior wrt the typedefed types. The actual change to SemaChecking turned out to be pretty gross, in particular:
  1. We need to extract the typedef'ed type for proper diagnostics
  2. We need to walk over paren expressions as well

Reviewers: chandlerc, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D6256

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222044 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd DiagID and Warning Flag to DiagnosticsLog
Steven Wu [Fri, 14 Nov 2014 21:23:56 +0000 (21:23 +0000)]
Add DiagID and Warning Flag to DiagnosticsLog

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222042 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMinGW doesn't implement std::to_string; working around it. NFC.
Aaron Ballman [Fri, 14 Nov 2014 20:31:50 +0000 (20:31 +0000)]
MinGW doesn't implement std::to_string; working around it. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222033 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove some redundant virtual specifiers on overriden functions.
David Blaikie [Fri, 14 Nov 2014 19:09:44 +0000 (19:09 +0000)]
Remove some redundant virtual specifiers on overriden functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222024 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTypo fix.
Yaron Keren [Fri, 14 Nov 2014 18:33:42 +0000 (18:33 +0000)]
Typo fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222016 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-cl: Ignore the new /Zo[-] option (PR21571)
Hans Wennborg [Fri, 14 Nov 2014 18:24:08 +0000 (18:24 +0000)]
clang-cl: Ignore the new /Zo[-] option (PR21571)

Also fix the ignored options test which didn't fail properly on
unknown options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222013 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: [Java] Further improve generics formatting.
Daniel Jasper [Fri, 14 Nov 2014 17:30:15 +0000 (17:30 +0000)]
clang-format: [Java] Further improve generics formatting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222011 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Correctly detect multiplication in ctor initializer.
Daniel Jasper [Fri, 14 Nov 2014 17:26:49 +0000 (17:26 +0000)]
clang-format: Correctly detect multiplication in ctor initializer.

Before:
  Constructor() : a(a), area(width *height) {}

After:
  Constructor() : a(a), area(width * height) {}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222010 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Sema]. Warn when logical expression is a pointer
Fariborz Jahanian [Fri, 14 Nov 2014 17:12:50 +0000 (17:12 +0000)]
[Sema]. Warn when logical expression is a pointer
which evaluates to true. rdar://18716393.
Reviewed by Richard Trieu

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222009 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSilencing a -Wparentheses warning; NFC.
Aaron Ballman [Fri, 14 Nov 2014 14:40:49 +0000 (14:40 +0000)]
Silencing a -Wparentheses warning; NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221998 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReplace weird whitespace symbols with good old spaces
Timur Iskhodzhanov [Fri, 14 Nov 2014 14:16:34 +0000 (14:16 +0000)]
Replace weird whitespace symbols with good old spaces

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221997 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd one illustrative class hierarchy as an example in a comment to the VFTableBuilder...
Timur Iskhodzhanov [Fri, 14 Nov 2014 14:10:15 +0000 (14:10 +0000)]
Add one illustrative class hierarchy as an example in a comment to the VFTableBuilder code

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221996 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoOops, the underline was too short for sphinx to like.
Aaron Ballman [Fri, 14 Nov 2014 14:01:55 +0000 (14:01 +0000)]
Oops, the underline was too short for sphinx to like.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221993 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCorrecting some grammar and typos, and adding CERT as a collaborator.
Aaron Ballman [Fri, 14 Nov 2014 13:48:34 +0000 (13:48 +0000)]
Correcting some grammar and typos, and adding CERT as a collaborator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221992 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoComplete support for the SD-6 standing document (based off N4200) with support for...
Aaron Ballman [Fri, 14 Nov 2014 13:44:02 +0000 (13:44 +0000)]
Complete support for the SD-6 standing document (based off N4200) with support for __has_cpp_attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221991 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Give clang-format-diff.py a -v option.
Daniel Jasper [Fri, 14 Nov 2014 13:27:28 +0000 (13:27 +0000)]
clang-format: Give clang-format-diff.py a -v option.

With it, it prints the file being formatted. Apparently people are
formatting thousands of files and some progress indication is helpful.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221990 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Improve function parameter packing.
Daniel Jasper [Fri, 14 Nov 2014 13:14:45 +0000 (13:14 +0000)]
clang-format: Improve function parameter packing.

Before:
  void SomeLoooooooooooongFunction(
      std::unique_ptr<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>
          aaaaaaaaaaaaaaaaaaaaaaaaaa, int bbbbbbbbbbbbb);

After:
  void SomeLoooooooooooongFunction(
      std::unique_ptr<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>
          aaaaaaaaaaaaaaaaaaaaaaaaaa,
      int bbbbbbbbbbbbb);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221989 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PowerPC] Enable vec_perm for long long and double vector types for VSX
Bill Schmidt [Fri, 14 Nov 2014 13:10:13 +0000 (13:10 +0000)]
[PowerPC] Enable vec_perm for long long and double vector types for VSX

VSX makes the "vector long long" and "vector double" types available.
This patch enables the vec_perm interface for these types.  The same
builtin is generated regardless of the specified type, so no
additional work or testing is needed in the back end.  Tests are added
to ensure this builtin is generated by the front end.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221988 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Support assignments as conditional operands.
Daniel Jasper [Fri, 14 Nov 2014 13:03:40 +0000 (13:03 +0000)]
clang-format: Support assignments as conditional operands.

Before:
  return a != b
             // comment
             ? a
             : a = a != b
                   // comment
         ? a =
               b : a;
After:
  return a != b
             // comment
             ? a
             : a = a != b
                       // comment
                       ? a = b
                       : a;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221987 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Improve indentation of comments in expressions.
Daniel Jasper [Fri, 14 Nov 2014 12:31:14 +0000 (12:31 +0000)]
clang-format: Improve indentation of comments in expressions.

Before:
  int i = (a)
              // comment
          + b;
  return aaaa == bbbb
                 // comment
             ? aaaa
             : bbbb;
After:
  int i = (a)
          // comment
          + b;
  return aaaa == bbbb
             // comment
             ? aaaa
             : bbbb;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221985 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PowerPC] Add VSX builtins for vec_div
Bill Schmidt [Fri, 14 Nov 2014 12:10:51 +0000 (12:10 +0000)]
[PowerPC] Add VSX builtins for vec_div

This patch adds builtin support for xvdivdp and xvdivsp, along with a
new test case.  The builtins are accessed using vec_div in altivec.h.
Builtins are listed (mostly) alphabetically there, so inserting these
changed the line numbers for deprecation warnings tested in
test/Headers/altivec-intrin.c.

There is a companion patch for LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221984 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: [Java] Fix line break behavior of class declarations.
Daniel Jasper [Fri, 14 Nov 2014 10:15:56 +0000 (10:15 +0000)]
clang-format: [Java] Fix line break behavior of class declarations.

Change breaking preferences:
1. Break before "extends"
2. Break before "implements"
3. Break within the implements list.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221981 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: [Java] Improve generic return type formatting.
Daniel Jasper [Fri, 14 Nov 2014 09:05:32 +0000 (09:05 +0000)]
clang-format: [Java] Improve generic return type formatting.

Before:
  public<R> ArrayList<R> get() {

After:
  public <R> ArrayList<R> get() {

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221979 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: [Java] No altnerative operator names in Java.
Daniel Jasper [Fri, 14 Nov 2014 09:02:28 +0000 (09:02 +0000)]
clang-format: [Java] No altnerative operator names in Java.

Before:
  someObject.and ();

After:
  someObject.and();

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221978 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: [Java] Improve formatting of generics.
Daniel Jasper [Fri, 14 Nov 2014 08:22:46 +0000 (08:22 +0000)]
clang-format: [Java] Improve formatting of generics.

Before:
  Function < F, ? extends T > function;

After:
  Function<F, ? extends T> function;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221976 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[OPENMP] Temporary fix for processing of global variables in loops.
Alexey Bataev [Fri, 14 Nov 2014 04:08:45 +0000 (04:08 +0000)]
[OPENMP] Temporary fix for processing of global variables in loops.
Currently there is a bug in processing of global variables used as loop control variables in 'omp for/simd' constructs: these globals must be captured as private variables, but currently they are nor. This is a temporary bug fix for this problem until the correct solution is prepared. If a global var used as lcv without explicit mark as a private/linear/lastprivate the error message is emitted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221970 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Sanitizer] Refactor SanitizerArgs parsing in Driver.
Alexey Samsonov [Fri, 14 Nov 2014 02:59:20 +0000 (02:59 +0000)]
[Sanitizer] Refactor SanitizerArgs parsing in Driver.

Remove flag parsing details from the public header.
Use SanitizerSet to represent the set of enabled sanitizers.
Cleanup the implementation: update the comments to
reflect reality, remove dead code.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221968 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove -fseh-exceptions in favor of checking the triple
Reid Kleckner [Fri, 14 Nov 2014 02:01:10 +0000 (02:01 +0000)]
Remove -fseh-exceptions in favor of checking the triple

This option was misleading because it looked like it enabled the
language feature of SEH (__try / __except), when this option was really
controlling which EH personality function to use. Mingw only supports
SEH and SjLj EH on x86_64, so we can simply do away with this flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221963 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCleanup SanitizerArgs: get rid of unused variable, make one method non-static. NFC.
Alexey Samsonov [Fri, 14 Nov 2014 00:46:39 +0000 (00:46 +0000)]
Cleanup SanitizerArgs: get rid of unused variable, make one method non-static. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221959 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPR21565 Add an egregious hack to support broken libstdc++ headers that declare
Richard Smith [Fri, 14 Nov 2014 00:37:55 +0000 (00:37 +0000)]
PR21565 Add an egregious hack to support broken libstdc++ headers that declare
a member named 'swap' and then expect unqualified lookup for the name 'swap' in
its exception specification to find anything else.

Without delay-parsed exception specifications, this was ill-formed (NDR) by
[basic.scope.class]p1, rule 2. With delay-parsed exception specifications, the
call to 'swap' unambiguously finds the function being declared, which then
fails because the arguments don't work for that function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221955 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Profile] Always build profile runtime library with -fPIC.
Alexey Samsonov [Fri, 14 Nov 2014 00:16:26 +0000 (00:16 +0000)]
[Profile] Always build profile runtime library with -fPIC.

This change removes libclang_rt.profile-pic-<arch>.a version of
profile runtime. Instead, it's sufficient to always build
libclang_rt.profile-<arch>.a with -fPIC, as it can be linked into
both executables and shared objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221952 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago-Wsentinel: Suggest nullptr in C++11 instead of NULL
Reid Kleckner [Thu, 13 Nov 2014 23:19:36 +0000 (23:19 +0000)]
-Wsentinel: Suggest nullptr in C++11 instead of NULL

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221945 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix assert/crash on invalid with __builtin_constant_p conditionals in constant expres...
Richard Smith [Thu, 13 Nov 2014 23:03:19 +0000 (23:03 +0000)]
Fix assert/crash on invalid with __builtin_constant_p conditionals in constant expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221942 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoObjective-C. Fixes a regression caused by implementation
Fariborz Jahanian [Thu, 13 Nov 2014 22:27:05 +0000 (22:27 +0000)]
Objective-C. Fixes a regression caused by implementation
of new warning for deprecated method call for receiver
of type 'id'. This addresses rdar://18960378 where
unintended warnings being issued.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221933 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPR21437, final part of DR1330: delay-parsing of exception-specifications. This
Richard Smith [Thu, 13 Nov 2014 20:01:57 +0000 (20:01 +0000)]
PR21437, final part of DR1330: delay-parsing of exception-specifications. This
is a re-commit of Doug's r154844 (modernized and updated to fit into current
Clang).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221918 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove -Wcast-qual as it's inherited from llvm since r221913.
Roman Divacky [Thu, 13 Nov 2014 19:47:31 +0000 (19:47 +0000)]
Remove -Wcast-qual as it's inherited from llvm since r221913.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221914 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoHook up FreeBSD AArch64 support
Ed Maste [Thu, 13 Nov 2014 16:55:42 +0000 (16:55 +0000)]
Hook up FreeBSD AArch64 support

Patch from Andrew Turner.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221900 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Format extern "C" blocks like namespace blocks.
Nico Weber [Thu, 13 Nov 2014 16:25:37 +0000 (16:25 +0000)]
clang-format: Format extern "C" blocks like namespace blocks.

namespace blocks act as if KeepEmptyLinesAtTheStartOfBlocks is always true,
and aren't collapsed to a single line even if they would fit. Do the same
for extern "C" blocks.

Before,

  extern "C" {

  void ExternCFunction();

  }

was collapsed into `extern "C" { void ExternCFunction(); }`. Now it stays like
it was.

Fixes http://crbug.com/432640 and part of PR21419.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221897 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: [Java] Support Java enums.
Daniel Jasper [Thu, 13 Nov 2014 15:56:28 +0000 (15:56 +0000)]
clang-format: [Java] Support Java enums.

In Java, enums can contain a class body and enum constants can have
arguments as well as class bodies. Support most of that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221895 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSupport non-owned DiagnosticConsumer in SetupSerializedDiagnostics
Alexander Kornienko [Thu, 13 Nov 2014 13:08:27 +0000 (13:08 +0000)]
Support non-owned DiagnosticConsumer in SetupSerializedDiagnostics

This fixes an assertion when running clang-tidy on a file having
--serialize-diagnostics in compiler options. Committing a regression test
for clang-tidy separately.

Patch by Aaron Wishnick!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221884 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[libclang] Make sure to visit the body of a CXXForRangeStmt.
Argyrios Kyrtzidis [Thu, 13 Nov 2014 09:50:19 +0000 (09:50 +0000)]
[libclang] Make sure to visit the body of a CXXForRangeStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221881 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[liblang] Handle CXXForRangeStmt during AST visitation.
Argyrios Kyrtzidis [Thu, 13 Nov 2014 09:03:21 +0000 (09:03 +0000)]
[liblang] Handle CXXForRangeStmt during AST visitation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221874 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCMake: Set HOST_LINK_VERSION on Darwin (PR21268)
Hans Wennborg [Thu, 13 Nov 2014 00:35:23 +0000 (00:35 +0000)]
CMake: Set HOST_LINK_VERSION on Darwin (PR21268)

The Autoconf build already does this, but it was never ported to
CMake. The host linker version affects the flags that Clang pass
to the linker, notably whether it passes -demangle or not.

http://reviews.llvm.org/D6239

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221844 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFixes test.
Fariborz Jahanian [Thu, 13 Nov 2014 00:19:30 +0000 (00:19 +0000)]
Fixes test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221843 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAnother test for PR19372, showing why we need to keep checking arguments after a...
Richard Smith [Wed, 12 Nov 2014 23:50:13 +0000 (23:50 +0000)]
Another test for PR19372, showing why we need to keep checking arguments after a pack expansion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221838 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd another testcase.
Richard Smith [Wed, 12 Nov 2014 23:43:08 +0000 (23:43 +0000)]
Add another testcase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221833 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPR19372: Keep checking template arguments after we see an argument pack
Richard Smith [Wed, 12 Nov 2014 23:38:38 +0000 (23:38 +0000)]
PR19372: Keep checking template arguments after we see an argument pack
expansion into a parameter pack; we know that we're still filling in that
parameter's arguments. Previously, if we hit this case for an alias template,
we'd try to substitute using non-canonical template arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221832 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTemporary revert r221818 until all the problems
Anton Korobeynikov [Wed, 12 Nov 2014 23:15:38 +0000 (23:15 +0000)]
Temporary revert r221818 until all the problems
with objc stuff will be resolved.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221829 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoNow really fix the typo in the test
Anton Korobeynikov [Wed, 12 Nov 2014 22:58:08 +0000 (22:58 +0000)]
Now really fix the typo in the test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221825 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate the tests to handle proper result type of (?:)
Anton Korobeynikov [Wed, 12 Nov 2014 22:48:38 +0000 (22:48 +0000)]
Update the tests to handle proper result type of (?:)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221824 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Objective-C++ IRGen] do not generate .cxx_construct
Fariborz Jahanian [Wed, 12 Nov 2014 22:37:43 +0000 (22:37 +0000)]
[Objective-C++ IRGen] do not generate .cxx_construct
for class that contains trivially-constructible struct ivar.
rdar://18950072

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221823 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix fallout from r219557
Anton Korobeynikov [Wed, 12 Nov 2014 22:19:06 +0000 (22:19 +0000)]
Fix fallout from r219557

Summary:
Consider the following nifty 1 liner: (0 ? csqrtl(2.0f) : sqrtl(2.0f)). One can easily obtain such code from e.g. tgmath. Right now it produces an assertion because we fail to do the promotion real => _Complex real.

The case was properly handled previously (old handleOtherComplexFloatConversion routine), but was forgotten in the current version. This seems to be about fallout from r219557

Reviewers: chandlerc, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D6217

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221821 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix brace init of unions with unnamed struct members
Reid Kleckner [Wed, 12 Nov 2014 21:30:23 +0000 (21:30 +0000)]
Fix brace init of unions with unnamed struct members

The check for unnamed members was intended to skip unnamed bitfields,
but it ended up skipping unnamed structs. This lead to an assertion in
IRGen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221818 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate Clang's SD-6 support to match N4200 (except for __has_cpp_attribute,
Richard Smith [Wed, 12 Nov 2014 21:16:38 +0000 (21:16 +0000)]
Update Clang's SD-6 support to match N4200 (except for __has_cpp_attribute,
which we don't yet implement).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221816 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPass the filter function_ref by value now that r221753 fixes the bug
Kaelyn Takata [Wed, 12 Nov 2014 18:34:08 +0000 (18:34 +0000)]
Pass the filter function_ref by value now that r221753 fixes the bug
that was preventing pass-by-value from working correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221803 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCheck for IRGen output when varag is used
Fariborz Jahanian [Wed, 12 Nov 2014 17:54:11 +0000 (17:54 +0000)]
Check for IRGen output when varag is used
in -funknown-anytype  mode (in lldb use).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221796 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate for llvm api change.
Rafael Espindola [Wed, 12 Nov 2014 14:48:44 +0000 (14:48 +0000)]
Update for llvm api change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221786 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSimplify code a bit by passing StreamFile to the BitstreamCursor constructor.
Rafael Espindola [Wed, 12 Nov 2014 14:42:25 +0000 (14:42 +0000)]
Simplify code a bit by passing StreamFile to the BitstreamCursor constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221784 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMark TypeDecls used in explicit destructor calls as referenced.
Nico Weber [Wed, 12 Nov 2014 04:33:52 +0000 (04:33 +0000)]
Mark TypeDecls used in explicit destructor calls as referenced.

Fixes PR21221. Patch by Axel Naumann, test by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221771 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PowerPC] Add vec_vsx_ld and vec_vsx_st intrinsics
Bill Schmidt [Wed, 12 Nov 2014 04:19:56 +0000 (04:19 +0000)]
[PowerPC] Add vec_vsx_ld and vec_vsx_st intrinsics

This patch enables the vec_vsx_ld and vec_vsx_st intrinsics for
PowerPC, which provide programmer access to the lxvd2x, lxvw4x,
stxvd2x, and stxvw4x instructions.

New code in altivec.h defines these in terms of new builtins, which
are themselves defined in BuiltinsPPC.def.  The builtins are converted
to LLVM intrinsics in CGBuiltin.cpp.  Additional code is added to
builtins-ppc-vsx.c to verify the correct generation of the intrinsics.

Note that I moved the other VSX builtins so all VSX builtins will be
alphabetical in their own section in BuiltinsPPC.def.

There is a companion patch for LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221768 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMark TypeDecls used in member initializers as referenced.
Nico Weber [Wed, 12 Nov 2014 03:52:25 +0000 (03:52 +0000)]
Mark TypeDecls used in member initializers as referenced.

Without this, -Wunused-local-typedef would incorrectly warn on the two typedefs
in this program:

void foo() {
  struct A {};
  struct B : public A {
    typedef A INHERITED;
    B() : INHERITED() {}

    typedef B SELF;
    B(int) : SELF() {}
  };
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221765 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format a few lines, fixes one 80col violation. nfc.
Nico Weber [Wed, 12 Nov 2014 03:44:43 +0000 (03:44 +0000)]
clang-format a few lines, fixes one 80col violation. nfc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221764 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTry a different workaround for GCC 4.7.2 lambda capture bug. The previous
Richard Smith [Wed, 12 Nov 2014 02:09:03 +0000 (02:09 +0000)]
Try a different workaround for GCC 4.7.2 lambda capture bug. The previous
workaround took us from wrong-code to ICE.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221754 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoInstantiate exception specifications when instantiating function types (other
Richard Smith [Wed, 12 Nov 2014 02:00:47 +0000 (02:00 +0000)]
Instantiate exception specifications when instantiating function types (other
than the type of a function declaration). We previously didn't instantiate
these at all! This also covers the pathological case where the only mention of
a parameter pack is within the exception specification; this gives us a second
way (other than alias templates) to reach the horrible state where a type
contains an unexpanded pack, but its canonical type does not.

This is a re-commit of r219977:

r219977 was reverted in r220038 because it hit a wrong-code bug in GCC 4.7.2.
(That's gcc.gnu.org/PR56135, and affects any implicit lambda-capture of
'this' within a template.)

r219977 was a re-commit of r217995, r218011, and r218053:

r217995 was reverted in r218058 because it hit a rejects-valid bug in MSVC.
(Incorrect overload resolution in the presence of using-declarations.)
It was re-committed in r219977 with a workaround for the MSVC rejects-valid.

r218011 was a workaround for an MSVC parser bug. (Incorrect desugaring of
unbraced range-based for loop).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221750 91177308-0d34-0410-b5e6-96231b3b80d8